MaiXinRong 5 年之前
父节点
当前提交
ade0fe7c3b
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/service/pos.js

+ 2 - 2
app/service/pos.js

@@ -101,7 +101,7 @@ module.exports = app => {
         async _getUpdateBills(data) {
             const datas = data instanceof Array ? data : [data];
             const bills = await this.ctx.service.ledger.getDataById(datas[0].lid);
-            const billsPos = await this.getAllDataByCondition({where: {lid: bills.id} });
+            const billsPos = await this.getAllDataByCondition({where: {tid: bills.tender_id, lid: bills.id} });
             const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);
             const updateBills = {id: bills.id};
             for (const bp of billsPos) {
@@ -360,7 +360,7 @@ module.exports = app => {
             const bills = await this.ctx.service.ledger.getDataById(data[0].lid);
             const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);
             const updateBills = {id: bills.id};
-            const billsPos = await this.getAllDataByCondition({where: {lid: bills.id} });
+            const billsPos = await this.getAllDataByCondition({where: {tid: tid, lid: bills.id} });
             for (const bp of billsPos) {
                 const d = data.find(function (x) {
                     return bp.id ? x.id === bp.id : false;