'use strict'; const Schema = require('mongoose').Schema; const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin'); const { Secret } = require('naf-framework-mongoose/lib/model/schema'); // 企业申请授信表 const LoanFollowSchema = { loanid: { type: String, required: true, maxLength: 100}, //小微数贷ID jkid: { type: String, required: true, maxLength: 200 }, //金控集团ID qyid: { type: String, required: true, maxLength: 200 }, //企业用户UID accept_time: { type: Number, maxLength: 200,default:0}, //受理时间(授信时间-创建时间) credit_money: { type: Number, maxLength: 200 ,default:0}, //授信额度 credit_time: { type: Number,default:0}, //授信时间(时间戳) orcredit: { type: String,default:'0' }//是否授信(0:未授信;1:已授信) }; const schema = new Schema(LoanFollowSchema, { toJSON: { virtuals: true } }); schema.index({ userid: 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('Loanfollow', schema, 'loanfollow'); };