lrf 2 years ago
parent
commit
dea31f68a4
2 changed files with 4 additions and 2 deletions
  1. 2 2
      app/controller/shop/config/.goods.js
  2. 2 0
      app/model/shop/goods.js

+ 2 - 2
app/controller/shop/config/.goods.js

@@ -1,6 +1,6 @@
 module.exports = {
   create: {
-    requestBody: ['shop', 'name', 'shot_brief', 'send_time', 'brief', 'file', 'tags', 'status'],
+    requestBody: ['act_tags', 'shop', 'name', 'shot_brief', 'send_time', 'brief', 'file', 'tags', 'status'],
   },
   destroy: {
     params: ['!id'],
@@ -8,7 +8,7 @@ module.exports = {
   },
   update: {
     params: ['!id'],
-    requestBody: ['shop', 'name', 'shot_brief', 'send_time', 'brief', 'file', 'tags', 'status'],
+    requestBody: ['act_tags', 'shop', 'name', 'shot_brief', 'send_time', 'brief', 'file', 'tags', 'status'],
   },
   show: {
     parameters: {

+ 2 - 0
app/model/shop/goods.js

@@ -13,6 +13,7 @@ const goods = {
   tags: { type: Array, required: false, zh: '商品标签' }, //
   view_num: { type: Number, required: false, default: 0, zh: '浏览量' }, //
   status: { type: String, required: false, default: '0', zh: '商品状态' }, // 字典:goods_status
+  act_tags: { type: Array, required: false, zh: '活动标签' }, // 字典:act_tags
 };
 const schema = new Schema(goods, { toJSON: { getters: true, virtuals: true } });
 schema.index({ id: 1 });
@@ -21,6 +22,7 @@ schema.index({ shop: 1 });
 schema.index({ name: 1 });
 schema.index({ status: 1 });
 schema.index({ view_num: 1 });
+schema.index({ act_tags: 1 });
 
 schema.plugin(metaPlugin);