reviewExpert.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const moment = require('moment');
  4. const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
  5. const { Secret } = require('naf-framework-mongoose-free/lib/model/schema');
  6. const { ObjectId } = require('mongoose').Types;
  7. // 评审专家表
  8. const review_expert = {
  9. expert_id: { type: String, required: false }, // 专家id
  10. expert_name: { type: String, required: false }, // 专家姓名
  11. phone: { type: String, required: false }, // 联系电话
  12. password: { type: Secret, select: false }, // 密码
  13. company: { type: String, required: false }, // 工作单位
  14. group_zw: { type: String, required: false }, // 评价专家组职务
  15. major: { type: String, required: false }, // 所学专业
  16. now_major: { type: String, required: false }, // 现从事专业
  17. zw: { type: String, required: false }, // 职务
  18. zc: { type: String, required: false }, // 职称
  19. apply_id: { type: String, required: false }, // 成果申请id
  20. score: { type: String, required: false }, // 分数
  21. desc: { type: String, required: false }, // 意见
  22. type: { type: String }, // 工作类型:1=>评分;2=>会审
  23. status: { type: String, required: false, default: '0', maxLength: 200 }, // 审核状态,0-注册,1-通过,2-拒绝,3-审核完成,账号不可用
  24. role: { type: String, required: false, default: '9' }, // 角色
  25. code: { type: String, required: false }, // 邀请码
  26. remark: { type: String },
  27. };
  28. const schema = new Schema(review_expert, { toJSON: { virtuals: true } });
  29. schema.index({ id: 1 });
  30. schema.index({ expert_id: 1 });
  31. schema.index({ apply_id: 1 });
  32. schema.index({ status: 1 });
  33. schema.index({ 'meta.createdAt': 1 });
  34. schema.plugin(metaPlugin);
  35. module.exports = app => {
  36. const { mongoose } = app;
  37. return mongoose.model('ReviewExpert', schema, 'reviewExpert');
  38. };