|
@@ -250,10 +250,13 @@ class OrderDetailService extends CrudService {
|
|
|
if (!entity) throw new BusinessError(ErrorCode.DATA_NOT_EXIST);
|
|
|
try {
|
|
|
this.tran.update('OrderDetail', filter._id, update);
|
|
|
- // 积分部分
|
|
|
- await this.ctx.service.user.point.addPoints(filter._id, this.tran);
|
|
|
- // 返现部分
|
|
|
- await this.ctx.service.user.cashBack.create(filter._id, this.tran);
|
|
|
+ if (_.get(update, 'status') === '3') {
|
|
|
+ // 积分部分
|
|
|
+ await this.ctx.service.user.point.addPoints(filter._id, this.tran);
|
|
|
+ // 返现部分
|
|
|
+ await this.ctx.service.user.cashBack.create(filter._id, this.tran);
|
|
|
+ }
|
|
|
+
|
|
|
await this.tran.run();
|
|
|
const e = await this.model.findOne(filter, projection).exec();
|
|
|
return e;
|