|
@@ -30,9 +30,9 @@ class ShopCashOutService extends CrudService {
|
|
|
async afterUpdate(filter, body, data) {
|
|
|
const { status } = body;
|
|
|
if (status === '1') {
|
|
|
- const { customer: inviter, money } = data;
|
|
|
- const obj = { inviter, money, time: moment().format('YYYY-MM-DD HH:mm:ss'), status: '-1', source: '-1', source_id: data._id };
|
|
|
- const num = await this.shopInBillModel.count({ inviter, status: '-1', source: '-1', source_id: data._id });
|
|
|
+ const { money: receipts, shop } = data;
|
|
|
+ const obj = { shop, receipts, time: moment().format('YYYY-MM-DD HH:mm:ss'), status: '-1', source: '-1', source_id: data._id };
|
|
|
+ const num = await this.shopInBillModel.count({ shop, status: '-1', source: '-1', source_id: data._id });
|
|
|
// 说明该申请没有流水,添加流水;有流水就不加了
|
|
|
if (num <= 0) await this.shopInBillModel.create(obj);
|
|
|
}
|