achieve_verify_record.js 1.1 KB

1234567891011121314151617181920212223242526
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const moment = require('moment');
  4. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  5. const { ObjectId } = require('mongoose').Types;
  6. // 审核记录表
  7. const achieve_verify_record = {
  8. apply_id: { type: ObjectId }, // 成果申请数据id
  9. desc: { type: String }, // 本次审核的意见
  10. status: { type: String }, // 本次审核的结果
  11. verify_id: { type: ObjectId }, // 本次审核人
  12. verify_phone: { type: String }, // 本次审核人的联系电话
  13. verify: { type: String }, // 本次审核人
  14. step: { type: String }, // 初审=>评分=>会审=>资料/发证书
  15. remark: { type: String, maxLength: 200 },
  16. create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
  17. };
  18. const schema = new Schema(achieve_verify_record, { toJSON: { virtuals: true } });
  19. schema.index({ id: 1 });
  20. schema.index({ apply_id: 1 });
  21. schema.index({ 'meta.createdAt': 1 });
  22. schema.plugin(metaPlugin);
  23. module.exports = app => {
  24. const { mongoose } = app;
  25. return mongoose.model('Achieve_verify_record', schema, 'achieve_verify_record');
  26. };