|
@@ -7,16 +7,22 @@ const { ObjectId } = require('mongoose').Types;
|
|
|
const duplicate = {
|
|
|
apply_id: { type: String }, // 原数据id
|
|
|
user_id: { type: String }, // 用户id
|
|
|
+ user_name: { type: String }, // 用户名
|
|
|
title: { type: String }, // 标题
|
|
|
apply_year: { type: String }, // 申请年度
|
|
|
project_info: { type: Object }, // 项目信息
|
|
|
apply_index: { type: Array }, // 绩效指标
|
|
|
status: { type: String, default: '0' }, // 0:草稿,1:待审中,2:审核通过,3:审核拒绝
|
|
|
record: { type: Array }, // 记录
|
|
|
+ excel: { type: Object }, // excel数据
|
|
|
remark: { type: String },
|
|
|
};
|
|
|
const schema = new Schema(duplicate, { toJSON: { virtuals: true } });
|
|
|
schema.index({ id: 1 });
|
|
|
+schema.index({ apply_id: 1 });
|
|
|
+schema.index({ user_id: 1 });
|
|
|
+schema.index({ user_name: 1 });
|
|
|
+schema.index({ status: 1 });
|
|
|
schema.index({ 'meta.createdAt': 1 });
|
|
|
schema.plugin(metaPlugin);
|
|
|
module.exports = app => {
|