expertsaudit.js 953 B

12345678910111213141516171819202122
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. // 专家申请审核表
  5. const ExpertsauditSchema = {
  6. expert_id: { type: String, required: true, maxLength: 500 }, // 专家ID
  7. expertname: { type: String, required: false, maxLength: 500 }, // 专家姓名
  8. userid: { type: String, required: true, maxLength: 500 }, // 申请人ID
  9. username: { type: String, required: false, maxLength: 500 }, // 申请人名称
  10. description: { type: String, required: false }, // 说明
  11. status: { type: String, required: true, maxLength: 500 }, // 交易状态,0-发起交易,1-交易中,2-交易成功,3-交易取消
  12. };
  13. const schema = new Schema(ExpertsauditSchema, { toJSON: { virtuals: true } });
  14. schema.index({ id: 1 });
  15. schema.plugin(metaPlugin);
  16. module.exports = app => {
  17. const { mongoose } = app;
  18. return mongoose.model('Expertsaudit', schema, 'experts_audit');
  19. };