"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 updateapply = { user_id: { type: String }, // 用户id user_name: { type: String }, // 用户名称 project_id: { type: String }, // 项目id project_name: { type: String }, // 项目名称 update_content: { type: String }, // 修改内容 status: { type: String, default: "0" }, // 0:待审中,1:机构审核通过,2:机构审核未通过,3:基础处审核通过,4:基础处审核未通过 record: { type: Array }, // 记录 remark: { type: String }, }; const schema = new Schema(updateapply, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.index({ user_id: 1 }); schema.index({ 'meta.createdAt': 1 }); schema.plugin(metaPlugin); module.exports = (app) => { const { mongoose } = app; return mongoose.model("Updateapply", schema, "updateapply"); };