cheny 5 年之前
父節點
當前提交
4165e2a633
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      app/service/transaction.js

+ 2 - 4
app/service/transaction.js

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