|
@@ -6,6 +6,7 @@ const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
|
|
const relationStudentCoach = {
|
|
const relationStudentCoach = {
|
|
student_id: { type: String, required: true, zh: '学生id', ref: 'Student', getProp: [ 'name' ] },
|
|
student_id: { type: String, required: true, zh: '学生id', ref: 'Student', getProp: [ 'name' ] },
|
|
coach_id: { type: String, required: true, zh: '教练id', ref: 'Coach', getProp: [ 'icon', 'name', 'phone', 'age', 'gender', 'level', 'honor' ] },
|
|
coach_id: { type: String, required: true, zh: '教练id', ref: 'Coach', getProp: [ 'icon', 'name', 'phone', 'age', 'gender', 'level', 'honor' ] },
|
|
|
|
+ school_id: { type: String, required: true, zh: '学校id', ref: 'School', getProp: [ 'name', 'phone' ] },
|
|
doc: { type: Object, required: false, zh: '档案' },
|
|
doc: { type: Object, required: false, zh: '档案' },
|
|
config: { type: Object, required: false, zh: '设置' },
|
|
config: { type: Object, required: false, zh: '设置' },
|
|
};
|
|
};
|
|
@@ -14,6 +15,7 @@ schema.index({ id: 1 });
|
|
schema.index({ 'meta.createdAt': 1 });
|
|
schema.index({ 'meta.createdAt': 1 });
|
|
schema.index({ student_id: 1 });
|
|
schema.index({ student_id: 1 });
|
|
schema.index({ coach_id: 1 });
|
|
schema.index({ coach_id: 1 });
|
|
|
|
+schema.index({ school_id: 1 });
|
|
|
|
|
|
schema.plugin(metaPlugin);
|
|
schema.plugin(metaPlugin);
|
|
module.exports = app => {
|
|
module.exports = app => {
|