|
@@ -7,23 +7,25 @@ const act_time = {
|
|
|
is_use: { type: String, zh: '是否使用' }, // 字典:is_use
|
|
|
};
|
|
|
// 平台活动
|
|
|
-const platform_act = {
|
|
|
+const platformAct = {
|
|
|
title: { type: String, required: false, zh: '活动标题' }, //
|
|
|
share: { type: Array, required: false, zh: '分享图片' }, //
|
|
|
cover: { type: Array, required: false, zh: '封面图片' }, //
|
|
|
act_time: { type: Object, required: false, zh: '活动时间' }, // value:值;is_use:字典(is_use)是否启用
|
|
|
content: { type: Object, required: false, zh: '活动说明' }, // 富文本;value:值;is_use:字典(is_use)是否启用
|
|
|
is_use: { type: String, required: false, default: '1', zh: '是否开启' }, // 字典:is_use,默认不开启
|
|
|
+ show_index: { type: String, required: false, default: '0', zh: '是否在首页显示' }, // 字典:is_use
|
|
|
};
|
|
|
-const schema = new Schema(platform_act, { toJSON: { getters: true, virtuals: true } });
|
|
|
+const schema = new Schema(platformAct, { toJSON: { getters: true, virtuals: true } });
|
|
|
schema.index({ id: 1 });
|
|
|
schema.index({ 'meta.createdAt': 1 });
|
|
|
schema.index({ title: 1 });
|
|
|
schema.index({ is_use: 1 });
|
|
|
+schema.index({ show_index: 1 });
|
|
|
|
|
|
schema.plugin(metaPlugin);
|
|
|
|
|
|
module.exports = app => {
|
|
|
const { mongoose } = app;
|
|
|
- return mongoose.model('Platform_Act', schema, 'platform_act');
|
|
|
+ return mongoose.model('PlatformAct', schema, 'platformAct');
|
|
|
};
|