|
@@ -13,6 +13,7 @@ const goodsSpec = {
|
|
can_group: { type: String, required: false, zh: '是否可以团购' }, // 字典:tf
|
|
can_group: { type: String, required: false, zh: '是否可以团购' }, // 字典:tf
|
|
group_config: { type: Object, required: false, zh: '团购设置' }, // 团购模块的设置:团购金额:money,需要人数:need_person
|
|
group_config: { type: Object, required: false, zh: '团购设置' }, // 团购模块的设置:团购金额:money,需要人数:need_person
|
|
file: { type: Array, required: false, zh: '图片' }, //
|
|
file: { type: Array, required: false, zh: '图片' }, //
|
|
|
|
+ sort: { type: Number, required: false, default: 0, zh: '排序' }, //
|
|
};
|
|
};
|
|
const schema = new Schema(goodsSpec, { toJSON: { getters: true, virtuals: true } });
|
|
const schema = new Schema(goodsSpec, { toJSON: { getters: true, virtuals: true } });
|
|
schema.index({ id: 1 });
|
|
schema.index({ id: 1 });
|
|
@@ -21,6 +22,7 @@ schema.index({ goods: 1 });
|
|
schema.index({ name: 1 });
|
|
schema.index({ name: 1 });
|
|
schema.index({ status: 1 });
|
|
schema.index({ status: 1 });
|
|
schema.index({ can_group: 1 });
|
|
schema.index({ can_group: 1 });
|
|
|
|
+schema.index({ sort: 1 });
|
|
|
|
|
|
schema.plugin(metaPlugin);
|
|
schema.plugin(metaPlugin);
|
|
schema.plugin(MoneyPlugin({ zh: '实际销售价格', required: false, key: 'sell_money' }));
|
|
schema.plugin(MoneyPlugin({ zh: '实际销售价格', required: false, key: 'sell_money' }));
|