shopCashOut.js 1.3 KB

123456789101112131415161718192021222324252627282930
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
  4. const MoneyPlugin = require('naf-framework-mongoose-free/lib/model/type-money-plugin');
  5. // 店铺提现申请
  6. const shopCashOut = {
  7. shop: { type: String, required: false, zh: '店铺', ref: 'Shop.Shop' }, //
  8. apply_time: { type: String, required: false, zh: '申请时间' }, //
  9. deal_person: { type: String, required: false, zh: '审核处理人', ref: 'User.admin' }, //
  10. exam_time: { type: String, required: false, zh: '审核时间' }, //
  11. card: { type: String, required: false, zh: '银行卡号' }, //
  12. card_name: { type: String, required: false, zh: '银行卡所属' }, //
  13. card_bank: { type: String, required: false, zh: '所属银行' }, //
  14. status: { type: String, required: false, default: '0', zh: '审核状态' }, // 字典表:withdrawal_exam_status
  15. };
  16. const schema = new Schema(shopCashOut, { toJSON: { getters: true, virtuals: true } });
  17. schema.index({ id: 1 });
  18. schema.index({ 'meta.createdAt': 1 });
  19. schema.index({ shop: 1 });
  20. schema.index({ status: 1 });
  21. schema.plugin(metaPlugin);
  22. schema.plugin(MoneyPlugin({ zh: '提现金额', required: false, key: 'money' }));
  23. module.exports = app => {
  24. const { mongoose } = app;
  25. return mongoose.model('ShopCashOut', schema, 'shopCashOut');
  26. };