|
@@ -2,6 +2,7 @@
|
|
const Schema = require('mongoose').Schema;
|
|
const Schema = require('mongoose').Schema;
|
|
const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
const { Secret } = require('naf-framework-mongoose/lib/model/schema');
|
|
const { Secret } = require('naf-framework-mongoose/lib/model/schema');
|
|
|
|
+const { ObjectId } = require('mongoose').Types;
|
|
|
|
|
|
// 医生表
|
|
// 医生表
|
|
const DoctorSchema = {
|
|
const DoctorSchema = {
|
|
@@ -18,11 +19,13 @@ const DoctorSchema = {
|
|
money: { type: String, required: false, maxLength: 200 }, // 总金额
|
|
money: { type: String, required: false, maxLength: 200 }, // 总金额
|
|
balance: { type: String, required: false, maxLength: 200 }, // 剩余金额
|
|
balance: { type: String, required: false, maxLength: 200 }, // 剩余金额
|
|
remark: { type: String, required: false }, // 备注
|
|
remark: { type: String, required: false }, // 备注
|
|
|
|
+ invite_id: { type: ObjectId, required: false }, // 邀请医生id
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
const schema = new Schema(DoctorSchema, { toJSON: { virtuals: true } });
|
|
const schema = new Schema(DoctorSchema, { toJSON: { virtuals: true } });
|
|
schema.index({ openid: 1 });
|
|
schema.index({ openid: 1 });
|
|
|
|
+schema.index({ 'meta.createdAt': 1 });
|
|
schema.plugin(metaPlugin);
|
|
schema.plugin(metaPlugin);
|
|
|
|
|
|
module.exports = app => {
|
|
module.exports = app => {
|