lrf 2 vuotta sitten
vanhempi
commit
641596841c

+ 1 - 1
app/model/apply/tempLessonApply.js

@@ -12,7 +12,7 @@ const tempLessonApply = {
   img_url: { type: Array, required: false, zh: '证据' }, //
   pay_id: { type: String, required: false, zh: '支付id', ref: 'PayOrder' }, //
 };
-const schema = new Schema(tempLessonApply, { toJSON: { virtuals: true } });
+const schema = new Schema(tempLessonApply, { toJSON: { getters: true, virtuals: true } });
 schema.index({ id: 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.index({ school_id: 1 });

+ 1 - 1
app/model/business/charge.js

@@ -12,7 +12,7 @@ const charge = {
   is_pay: { type: String, required: false, zh: '支付状态' }, // 0:未支付;1:支付成功;-1:支付失败;-3:已退款
   time: { type: String, required: false, zh: '时间' }, //
 };
-const schema = new Schema(charge, { toJSON: { virtuals: true } });
+const schema = new Schema(charge, { toJSON: { getters: true, virtuals: true } });
 schema.index({ id: 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.index({ school_id: 1 });

+ 1 - 1
app/model/business/coachInBill.js

@@ -10,7 +10,7 @@ const coachInBill = {
   school_id: { type: String, required: false, zh: '学校id', ref: 'School', getProp: [ 'name' ] }, //
   coach_id: { type: String, required: false, zh: '教练id', ref: 'Coach', getProp: [ 'name' ] }, //
 };
-const schema = new Schema(coachInBill, { toJSON: { virtuals: true } });
+const schema = new Schema(coachInBill, { toJSON: { getters: true, virtuals: true } });
 schema.index({ id: 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.index({ school_id: 1 });

+ 2 - 2
app/model/business/lesson.js

@@ -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');

+ 1 - 1
app/model/business/lessonCoach.js

@@ -10,7 +10,7 @@ const lessonCoach = {
   coach_id: { type: String, required: false, zh: '教练id', ref: 'Coach', getProp: [ 'name' ] }, //
   is_sign: { type: String, required: false, default: '0', zh: '签到' }, // 0:未到;1:已签到
 };
-const schema = new Schema(lessonCoach, { toJSON: { virtuals: true } });
+const schema = new Schema(lessonCoach, { toJSON: { getters: true, virtuals: true } });
 schema.index({ id: 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.index({ lesson_id: 1 });

+ 1 - 1
app/model/business/lessonStudent.js

@@ -15,7 +15,7 @@ const lessonStudent = {
   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 } });
+const schema = new Schema(lessonStudent, { toJSON: { getters: true, virtuals: true } });
 schema.index({ id: 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.index({ lesson_id: 1 });

+ 1 - 1
app/model/business/payOrder.js

@@ -17,7 +17,7 @@ const payOrder = {
   status: { type: String, required: false, default: '0', zh: '支付状态' }, // 0:未支付;1:已支付;-1:支付失败;-3:已退款
   config: { type: Object, zh: '设置' },
 };
-const schema = new Schema(payOrder, { toJSON: { virtuals: true } });
+const schema = new Schema(payOrder, { toJSON: { getters: true, virtuals: true } });
 schema.index({ id: 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.index({ openid: 1 });

+ 1 - 1
app/model/relation/relationStudentSchool.js

@@ -14,7 +14,7 @@ const relationStudentSchool = {
   school_id: { type: String, required: false, zh: '学校id', ref: 'School', getProp: [ 'img_url', 'name', 'phone', 'coach_num', 'student_num', 'address', 'brief' ] }, //
   doc: { type: Object, required: false, zh: '档案' }, //
 };
-const schema = new Schema(relationStudentSchool, { toJSON: { virtuals: true } });
+const schema = new Schema(relationStudentSchool, { toJSON: { getters: true, virtuals: true } });
 schema.index({ id: 1 });
 schema.index({ student_id: 1 });
 schema.index({ school_id: 1 });

+ 0 - 16
app/z_router/utils.js

@@ -1,16 +0,0 @@
-'use strict';
-// 路由配置
-const routerRegister = require('../public/routerRegister');
-const rkey = 'utils';
-const ckey = 'utils';
-const keyZh = '工具';
-const routes = [
-  { method: 'post', path: `${rkey}`, controller: `${ckey}.index`, name: `${ckey}Index`, zh: '工具测试' },
-  { method: 'get', path: `${rkey}/readModel/:model`, controller: `${ckey}.readModel`, name: `${ckey}ReadModel`, zh: 'model查询' },
-  { method: 'get', path: `${rkey}/readFields/:model`, controller: `${ckey}.readFields`, name: `${ckey}ReadFields`, zh: 'fields查询' },
-  { method: 'post', path: `${rkey}/getPageMeta`, controller: `${ckey}.getPageMeta`, name: `${ckey}GetPageMeta`, zh: '查询页面元信息' },
-];
-
-module.exports = app => {
-  routerRegister(app, routes, keyZh, rkey, ckey);
-};