|
@@ -1,14 +1,13 @@
|
|
|
'use strict';
|
|
|
const Schema = require('mongoose').Schema;
|
|
|
const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
|
|
|
-const { Decimal128 } = require('mongoose').Types;
|
|
|
+const moneyPlugin = require('naf-framework-mongoose-free/lib/model/type-money-plugin');
|
|
|
|
|
|
|
|
|
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: Decimal128, 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' ] },
|
|
|
is_try: { type: String, required: false, default: '0', zh: '是否试课' },
|
|
|
try_status: { type: String, default: '0', zh: '试课审核状态' },
|
|
|
is_pay: { type: String, default: '0', zh: '是否已支付' },
|
|
@@ -28,6 +27,7 @@ schema.index({ is_pay: 1 });
|
|
|
schema.index({ is_sign: 1 });
|
|
|
|
|
|
schema.plugin(metaPlugin);
|
|
|
+schema.plugin(moneyPlugin({ zh: '缴费金额' }));
|
|
|
module.exports = app => {
|
|
|
const { mongoose } = app;
|
|
|
return mongoose.model('LessonStudent', schema, 'lessonStudent');
|