cheny 5 years ago
parent
commit
9015b2fa56
1 changed files with 3 additions and 2 deletions
  1. 3 2
      app/service/transaction.js

+ 3 - 2
app/service/transaction.js

@@ -30,10 +30,11 @@ class TransactionService extends CrudService {
       const market_user = await this.umodel.findById(market_userid);
       const market_user = await this.umodel.findById(market_userid);
       market_username = market_user.name;
       market_username = market_user.name;
     }
     }
+    const tran = await this.model.create(newdata);
     const newdata = { ...data, username, product_name, market_username };
     const newdata = { ...data, username, product_name, market_username };
-    const operationlogdata = { transaction: data, type: '1' };
+    const operationlogdata = { transaction: tran, type: '1' };
     this.omodel.create(operationlogdata);
     this.omodel.create(operationlogdata);
-    return await this.model.create(newdata);
+    return tran;
   }
   }
   async findTransactionList({ product_id }) {
   async findTransactionList({ product_id }) {
     const product = await this.model.find({ product_id });
     const product = await this.model.find({ product_id });