|
@@ -1,18 +1,20 @@
|
|
|
'use strict';
|
|
|
const Schema = require('mongoose').Schema;
|
|
|
const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
|
|
|
+const { Decimal128 } = require('mongoose').Types;
|
|
|
|
|
|
// 课程表-学员
|
|
|
const lessonStudent = {
|
|
|
- lesson_id: { type: String, required: false, zh: '课程id', ref: 'Lesson', getProp: [ 'name' ] }, //
|
|
|
- school_id: { type: String, required: false, zh: '学校id', ref: 'School', getProp: [ 'name' ] }, //
|
|
|
- student_id: { type: String, required: false, zh: '学生id', ref: 'Student', getProp: [ 'name' ] }, //
|
|
|
- money: { type: String, required: false, zh: '缴费金额' }, //
|
|
|
+ lesson_id: { type: String, required: false, zh: '课程id', ref: 'Lesson', getProp: ['name'] }, //
|
|
|
+ school_id: { type: String, required: false, zh: '学校id', ref: 'School', getProp: ['name'] }, //
|
|
|
+ student_id: { type: String, required: false, zh: '学生id', ref: 'Student', getProp: ['name'] }, //
|
|
|
+ money: { type: Decimal128, required: false, zh: '缴费金额' }, //
|
|
|
is_try: { type: String, required: false, default: '0', zh: '是否试课' }, // 0:非试课;1:试课
|
|
|
try_status: { type: String, default: '0', zh: '试课审核状态' }, // 0:未审核;1:审核通过;2审核拒绝
|
|
|
is_pay: { type: String, default: '0', zh: '是否已支付' }, // 0:未支付;1:已支付:-1:支付失败:-3已退款
|
|
|
pay_id: { type: String, required: false, zh: '支付id', ref: 'PayOrder' }, //
|
|
|
config: { type: Array, required: false, zh: '学生与教练关系表的设置快照' }, //
|
|
|
+ is_sign: { type: String, required: false, default: '0', zh: '签到' }, // 0:未到;1:已签到
|
|
|
};
|
|
|
const schema = new Schema(lessonStudent, { toJSON: { virtuals: true } });
|
|
|
schema.index({ id: 1 });
|
|
@@ -23,6 +25,7 @@ schema.index({ student_id: 1 });
|
|
|
schema.index({ pay_id: 1 });
|
|
|
schema.index({ is_try: 1 });
|
|
|
schema.index({ is_pay: 1 });
|
|
|
+schema.index({ is_sign: 1 });
|
|
|
|
|
|
schema.plugin(metaPlugin);
|
|
|
module.exports = app => {
|