cheny %!s(int64=5) %!d(string=hai) anos
pai
achega
4165e2a633
Modificáronse 1 ficheiros con 2 adicións e 4 borrados
  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;
       market_username = market_user.name;
     }
     }
     const newdata = { ...data, username, product_name, market_username };
     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);
     this.omodel.create(operationlogdata);
-    return tran;
+    return await this.model.create(newdata);
   }
   }
   async findTransactionList({ product_id }) {
   async findTransactionList({ product_id }) {
     const product = await this.model.find({ product_id });
     const product = await this.model.find({ product_id });