loanfollow.js 1.1 KB

12345678910111213141516171819202122232425262728
  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 LoanFollowSchema = {
  7. loanid: { type: String, required: true, maxLength: 100}, //小微数贷ID
  8. jkid: { type: String, required: true, maxLength: 200 }, //金控集团ID
  9. qyid: { type: String, required: true, maxLength: 200 }, //企业用户UID
  10. accept_time: { type: Number, maxLength: 200,default:0}, //受理时间(授信时间-创建时间)
  11. credit_money: { type: Number, maxLength: 200 ,default:0}, //授信额度
  12. credit_time: { type: Number,default:0}, //授信时间(时间戳)
  13. orcredit: { type: String,default:'0' }//是否授信(0:未授信;1:已授信)
  14. };
  15. const schema = new Schema(LoanFollowSchema, { toJSON: { virtuals: true } });
  16. schema.index({ userid: 1 });
  17. schema.plugin(metaPlugin);
  18. module.exports = app => {
  19. const { mongoose } = app;
  20. return mongoose.model('Loanfollow', schema, 'loanfollow');
  21. };