|
@@ -6,6 +6,7 @@ const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
|
|
|
const lesson = {
|
|
|
school_id: { type: String, required: false, zh: '学校id', ref: 'School', getProp: [ 'name' ] }, //
|
|
|
coach_id: { type: String, required: false, zh: '教练id', ref: 'Coach', getProp: [ 'name' ] }, //
|
|
|
+ title: { type: String, zh: '标题' },
|
|
|
class_hour: { type: Number, required: false, zh: '课时' }, //
|
|
|
money: { type: Number, required: false, zh: '金额' }, //
|
|
|
student: { type: Array, ref: 'Student', getProp: [ 'name' ], zh: '学员' },
|
|
@@ -15,6 +16,7 @@ const schema = new Schema(lesson, { toJSON: { virtuals: true } });
|
|
|
schema.index({ id: 1 });
|
|
|
schema.index({ 'meta.createdAt': 1 });
|
|
|
schema.index({ school_id: 1 });
|
|
|
+schema.index({ title: 1 });
|
|
|
schema.index({ coach_id: 1 });
|
|
|
schema.index({ type: 1 });
|
|
|
|