|
@@ -0,0 +1,27 @@
|
|
|
+'use strict';
|
|
|
+const Schema = require('mongoose').Schema;
|
|
|
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
|
+
|
|
|
+// 科技超市产品合同表
|
|
|
+const ProductpactSchema = {
|
|
|
+ dockid: { type: String, required: false, maxLength: 500 }, // 对接id
|
|
|
+ product_id: { type: String, required: true, maxLength: 500 }, // 产品ID
|
|
|
+ product_name: { type: String, required: false, maxLength: 500 }, // 产品名称
|
|
|
+ description: { type: String, required: false }, // 描述
|
|
|
+ userid: { type: String, required: true, maxLength: 500 }, // 购买人ID
|
|
|
+ username: { type: String, required: false, maxLength: 500 }, // 购买人名称
|
|
|
+ market_userid: { type: String, required: true, maxLength: 500 }, // 营销人ID
|
|
|
+ market_username: { type: String, required: false, maxLength: 500 }, // 营销人名称
|
|
|
+ status: { type: String, required: false, maxLength: 200, default: '0' }, // 状态(0:待审核 1:通过审核)
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+const schema = new Schema(ProductpactSchema, { toJSON: { virtuals: true } });
|
|
|
+schema.index({ id: 1 });
|
|
|
+schema.index({ product_id: 1 });
|
|
|
+schema.plugin(metaPlugin);
|
|
|
+
|
|
|
+module.exports = app => {
|
|
|
+ const { mongoose } = app;
|
|
|
+ return mongoose.model('Productpact', schema, 'market_product_pact');
|
|
|
+};
|