1234567891011121314151617181920212223 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const moment = require('moment');
- const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
- const { ObjectId } = require('mongoose').Types;
- // 评审专家表
- const review_expert = {
- expert_id: { type: String, required: false }, // 专家id
- apply_id: { type: String, required: false }, // 成果申请id
- verify: { type: Object }, // 评审详情:分数:score;意见:content
- type: { type: String }, // 工作类型:1=>评分;2=>会审
- 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({ 'meta.createdAt': 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Review_expert', schema, 'review_expert');
- };
|