t_platformApply.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * 平台申请接入表
  3. */
  4. var mongoose = require("./mongodb");
  5. var Schema = mongoose.Schema;
  6. var moment=require("moment");
  7. var platformApplySchema = new Schema(
  8. {
  9. applyName:{type: String,default:''},//申请人
  10. tel:{type: String,default:''},//联系电话
  11. mail:{type: String,default:''},//联系邮箱
  12. ENTERPRISE_CODE:{type: String,default:''},//社会信用代码证/身份证
  13. ENTERPRISE_NAME:{type: String,default:''},//申请单位名称
  14. request:{type: String,default:''},//申请需求
  15. applicationTime:{type: Date,default:Date.now()},//申请时间
  16. validName:{type: String,default:''},//审核人
  17. auditTime:{type: Date,default:Date.now()},//审核时间
  18. result:{type: Number,default:0},//审核结果 0待审核1通过2未通过
  19. memo:{type: String,default:''},//审核结果说明
  20. charger:{type: String,default:''},//指定负责人
  21. chargerMail:{type: String,default:''},//负责人联系邮箱
  22. Deleted:{type: Number,default:0}//是否已删除 默认0未删除 1已删除
  23. },{
  24. strict: true,
  25. toObject: {
  26. virtuals: true
  27. },
  28. toJSON: {
  29. virtuals: true
  30. }
  31. });
  32. platformApplySchema.virtual('applicationTime2').get(function () {
  33. if(this.applicationTime =="")//判断传入的参数
  34. {
  35. return "";
  36. };
  37. return moment(this.applicationTime).format('YYYY-MM-DD HH:mm:ss');
  38. });
  39. platformApplySchema.virtual('auditTime2').get(function () {
  40. if(this.auditTime =="")//判断传入的参数
  41. {
  42. return "";
  43. };
  44. return moment(this.auditTime).format('YYYY-MM-DD HH:mm:ss');
  45. });
  46. var platformApply = mongoose.model('platformApply',
  47. platformApplySchema,'t_platformApply');
  48. module.exports = platformApply;