vip.js 831 B

1234567891011121314151617181920212223242526272829
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const SchemaDefine = {
  4. // 头像
  5. thumbnail: { type: String, required: false },
  6. // 昵称
  7. name: { type: String, required: true },
  8. // 手机号
  9. phone: { type: String, required: true },
  10. // 单位
  11. company: { type: String, required: false },
  12. // 标识
  13. vipTab: { type: String, required: false },
  14. // 标识
  15. tab: { type: String, required: false },
  16. // openid
  17. openid: { type: String, required: true },
  18. // 状态:0=正常,1=过期
  19. status: { type: String, required: true },
  20. // 创建时间
  21. startTime: { type: Number, required: true },
  22. // 结束时间
  23. endTime: { type: Number, required: true },
  24. };
  25. const schema = new Schema(SchemaDefine);
  26. module.exports = app => {
  27. const { mongoose } = app;
  28. return mongoose.model('vip', schema, 'vip');
  29. };