|
@@ -32,7 +32,9 @@ class CashOutService extends CrudService {
|
|
|
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 };
|
|
|
- await this.cashBackModel.create(obj);
|
|
|
+ const num = await this.cashBackModel.count({ inviter, status: '-1', source: '-1', source_id: data._id });
|
|
|
+ // 说明该申请没有流水,添加流水;有流水就不加了
|
|
|
+ if (num < 0) await this.cashBackModel.create(obj);
|
|
|
}
|
|
|
return data;
|
|
|
}
|