'use strict'; const Schema = require('mongoose').Schema; const moment = require('moment'); const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin'); const { Secret } = require('naf-framework-mongoose-free/lib/model/schema'); const { ObjectId } = require('mongoose').Types; // 评审专家表 const review_expert = { expert_id: { type: String, required: false }, // 专家id expert_name: { type: String, required: false }, // 专家姓名 phone: { type: String, required: false }, // 联系电话 password: { type: Secret, select: false }, // 密码 company: { type: String, required: false }, // 工作单位 group_zw: { type: String, required: false }, // 评价专家组职务 major: { type: String, required: false }, // 所学专业 now_major: { type: String, required: false }, // 现从事专业 zw: { type: String, required: false }, // 职务 zc: { type: String, required: false }, // 职称 apply_id: { type: String, required: false }, // 成果申请id score: { type: String, required: false }, // 分数 desc: { type: String, required: false }, // 意见 type: { type: String }, // 工作类型:1=>评分;2=>会审 status: { type: String, required: false, default: '0', maxLength: 200 }, // 审核状态,0-注册,1-通过,2-拒绝,3-审核完成,账号不可用 remark: { type: String }, }; const schema = new Schema(review_expert, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.index({ expert_id: 1 }); schema.index({ apply_id: 1 }); schema.index({ status: 1 }); schema.index({ 'meta.createdAt': 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('ReviewExpert', schema, 'reviewExpert'); };