'use strict'; const Schema = require('mongoose').Schema; const moment = require('moment'); const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin'); const { ObjectId } = require('mongoose').Types; // 审核记录表 const achieve_verify_record = { apply_id: { type: ObjectId }, // 成果申请数据id desc: { type: String }, // 本次审核的意见 status: { type: String }, // 本次审核的结果 verify_id: { type: ObjectId }, // 本次审核人 verify_phone: { type: String }, // 本次审核人的联系电话 verify: { type: String }, // 本次审核人 step: { type: String }, // 初审=>评分=>会审=>资料/发证书 remark: { type: String, maxLength: 200 }, create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') }, }; const schema = new Schema(achieve_verify_record, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.index({ apply_id: 1 }); schema.index({ 'meta.createdAt': 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('Achieve_verify_record', schema, 'achieve_verify_record'); };