updateapply.js 1.0 KB

12345678910111213141516171819202122232425
  1. "use strict";
  2. const Schema = require("mongoose").Schema;
  3. const moment = require("moment");
  4. const metaPlugin = require("naf-framework-mongoose-free/lib/model/meta-plugin");
  5. const { ObjectId } = require("mongoose").Types;
  6. // 绩效修改申请表
  7. const updateapply = {
  8. user_id: { type: String }, // 用户id
  9. user_name: { type: String }, // 用户名称
  10. project_id: { type: String }, // 项目id
  11. project_name: { type: String }, // 项目名称
  12. update_content: { type: String }, // 修改内容
  13. status: { type: String, default: "0" }, // 0:待审中,1:机构审核通过,2:机构审核未通过,3:基础处审核通过,4:基础处审核未通过
  14. record: { type: Array }, // 记录
  15. remark: { type: String },
  16. };
  17. const schema = new Schema(updateapply, { toJSON: { virtuals: true } });
  18. schema.index({ id: 1 });
  19. schema.index({ user_id: 1 });
  20. schema.index({ 'meta.createdAt': 1 });
  21. schema.plugin(metaPlugin);
  22. module.exports = (app) => {
  23. const { mongoose } = app;
  24. return mongoose.model("Updateapply", schema, "updateapply");
  25. };