cheny %!s(int64=5) %!d(string=hai) anos
pai
achega
c84bc35117
Modificáronse 2 ficheiros con 15 adicións e 2 borrados
  1. 11 0
      app/model/operationlog.js
  2. 4 2
      app/service/transaction.js

+ 11 - 0
app/model/operationlog.js

@@ -11,6 +11,17 @@ const OperationlogSchema = {
   operation_result: { type: String, required: false, maxLength: 5 }, // 0成功 1失败
   type: { type: String, required: false, maxLength: 5, default: '0' }, // 0登录者信息、1操作信息、2.。。
   remark: { type: String, required: false, maxLength: 500 }, // 说明
+  dockid: { type: String, required: false, maxLength: 500 }, // 对接id
+  create_userid: { type: String, required: false, maxLength: 500 }, // 对接id
+  userid: { type: String, required: true, maxLength: 500 }, // 购买人ID
+  username: { type: String, required: false, maxLength: 500 }, // 购买人名称
+  product_id: { type: String, required: true, maxLength: 500 }, // 产品ID
+  product_name: { type: String, required: false, maxLength: 500 }, // 产品名称
+  market_userid: { type: String, required: true, maxLength: 500 }, // 营销人ID
+  market_username: { type: String, required: false, maxLength: 500 }, // 营销人名称
+  description: { type: String, required: false, maxLength: 500 }, // 说明
+  types: { type: String, required: false, maxLength: 20, default: '0' }, // 类别0、产品、1、专家
+  status: { type: String, required: true, maxLength: 500 }, // 交易状态,0-发起交易,1-交易中,2-交易成功,3-交易取消
 };
 const schema = new Schema(OperationlogSchema, { toJSON: { virtuals: true } });
 schema.index({ id: 1 });

+ 4 - 2
app/service/transaction.js

@@ -17,7 +17,8 @@ class TransactionService extends CrudService {
   }
 
   async create(data) {
-    const { userid, product_id, market_userid, description, status, username, product_name, market_username } = data;
+    console.log(data);
+    const { dockid, userid, product_id, market_userid, description, status, username, product_name, market_username } = data;
     if (!username) {
       const user = await this.umodel.findById(userid);
       username = user.name;
@@ -31,7 +32,8 @@ class TransactionService extends CrudService {
       market_username = market_user.name;
     }
     const newdata = { ...data, username, product_name, market_username };
-    const operationlogdata = { transaction: data, type: '1' };
+    console.log(data);
+    const operationlogdata = { dockid, userid, product_id, market_userid, description, status, username, product_name, market_username, type: '1' };
     this.omodel.create(operationlogdata);
     return await this.model.create(newdata);
   }