lrf 2 năm trước cách đây
mục cha
commit
698bfcc632
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 7 0
      app/service/user/cashOut.js

+ 7 - 0
app/service/user/cashOut.js

@@ -20,6 +20,13 @@ class CashOutService extends CrudService {
     return data;
   }
 
+  async beforeUpdate(filter, update) {
+    if (_.get(update, 'status') !== '0') {
+      update.deal_person = _.get(this.ctx, 'admin._id');
+    }
+    return { filter, update };
+  }
+
   async afterUpdate(filter, body, data) {
     const { status } = body;
     if (status === '1') {