'use strict'; const Schema = require('mongoose').Schema; const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin'); const MoneyPlugin = require('naf-framework-mongoose-free/lib/model/type-money-plugin'); // 店铺提现申请 const shopCashOut = { shop: { type: String, required: false, zh: '店铺', ref: 'Shop.Shop' }, // apply_time: { type: String, required: false, zh: '申请时间' }, // deal_person: { type: String, required: false, zh: '审核处理人', ref: 'User.admin' }, // exam_time: { type: String, required: false, zh: '审核时间' }, // card: { type: String, required: false, zh: '银行卡号' }, // card_name: { type: String, required: false, zh: '银行卡所属' }, // card_bank: { type: String, required: false, zh: '所属银行' }, // status: { type: String, required: false, default: '0', zh: '审核状态' }, // 字典表:withdrawal_exam_status }; const schema = new Schema(shopCashOut, { toJSON: { getters: true, virtuals: true } }); schema.index({ id: 1 }); schema.index({ 'meta.createdAt': 1 }); schema.index({ shop: 1 }); schema.index({ status: 1 }); schema.plugin(metaPlugin); schema.plugin(MoneyPlugin({ zh: '提现金额', required: false, key: 'money' })); module.exports = app => { const { mongoose } = app; return mongoose.model('ShopCashOut', schema, 'shopCashOut'); };