marketuser.js 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. const { Secret } = require('naf-framework-mongoose/lib/model/schema');
  5. // 科技超市用户表
  6. const MarketuserSchema = {
  7. name: { type: String, required: true, maxLength: 200 }, // 用户名
  8. password: { type: Secret, required: true, select: false }, // 登录密码
  9. phone: { type: String, required: false, maxLength: 200 }, // 电话号码
  10. email: { type: String, required: false, maxLength: 200 }, // 邮箱
  11. addr: { type: String, required: false, maxLength: 500 }, // 地址
  12. img_path: { type: String, required: false }, // 头像图片
  13. resume: { type: String, required: false }, // 个人简介
  14. major: { type: String, required: false }, // 专业领域
  15. institution_code: { type: String, required: false, maxLength: 500 }, // 机构代码
  16. office_phone: { type: String, required: false, maxLength: 500 }, // 办公电话
  17. profession: { type: String, required: false, maxLength: 500 }, // 所属行业
  18. status: { type: String, required: false, default: '0', maxLength: 200 }, // 审核状态,0-注册,1-通过,2-拒绝
  19. is_del: { type: String, required: false, maxLength: 200 }, // 是否删除,0-否,1-是
  20. role: { type: String, required: false, maxLength: 200 }, // 1-管理员,2-个人,3-企业管理员,4-子管理员
  21. token: { type: String, required: false, maxLength: 500 }, // 令牌
  22. columnid: [ String ],
  23. pid: { type: String, required: false }, // 父id
  24. deptname: { type: String, required: false }, // 机构名称
  25. code: { type: String, required: false }, // 邀请码
  26. openid: { type: String, required: false }, // 微信openid
  27. companytype: { type: String, required: false, maxLength: 300 }, // 注册类型
  28. companydate: { type: String, required: false, maxLength: 300 }, // 注册时间
  29. companycapital: { type: String, required: false, maxLength: 300 }, // 注册资金
  30. companyperson: { type: String, required: false, maxLength: 300 }, // 企业法人
  31. sndqyzsr: { type: String, required: false, maxLength: 300 }, // 上年度企业总收入
  32. sndyffy: { type: String, required: false, maxLength: 300 }, // 上年度研发费用
  33. companytotal: { type: String, required: false, maxLength: 300 }, // 企业总人数
  34. zjzyfrs: { type: String, required: false, maxLength: 300 }, // 专&兼职研发人数
  35. companybrief: { type: String, required: false }, // 企业简介
  36. mainproduct: { type: String, required: false, maxLength: 300 }, // 主要产品
  37. qualifications: { type: String, required: false, maxLength: 300 }, // 企业资质&荣誉
  38. isdel: { type: String, required: false, default: '0' }, // 0=>未删除;1=>已删除
  39. };
  40. const schema = new Schema(MarketuserSchema, { toJSON: { virtuals: true } });
  41. schema.index({ id: 1 });
  42. schema.plugin(metaPlugin);
  43. module.exports = app => {
  44. const { mongoose } = app;
  45. return mongoose.model('Marketuser', schema, 'marketuser');
  46. };