|
@@ -15,7 +15,7 @@ const lesson = {
|
|
|
status: { type: String, required: false, zh: '状态', default: '0' }, // 0-准备中;1-报名中;2-报名结束;3-已开课;4-已结课;-1-停课
|
|
|
brief: { type: String, required: false, zh: '简介' }, //
|
|
|
};
|
|
|
-const schema = new Schema(lesson, { toJSON: { virtuals: true } });
|
|
|
+const schema = new Schema(lesson, { toJSON: { getters: true, virtuals: true } });
|
|
|
schema.index({ id: 1 });
|
|
|
schema.index({ 'meta.createdAt': 1 });
|
|
|
schema.index({ school_id: 1 });
|
|
@@ -23,7 +23,7 @@ schema.index({ time_start: 1 });
|
|
|
schema.index({ time_end: 1 });
|
|
|
|
|
|
schema.plugin(metaPlugin);
|
|
|
-schema.plugin(moneyPlugin({ zh: '金额' }));
|
|
|
+schema.plugin(moneyPlugin({ zh: '工资' }));
|
|
|
module.exports = app => {
|
|
|
const { mongoose } = app;
|
|
|
return mongoose.model('Lesson', schema, 'lesson');
|