123456789101112131415161718192021222324 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
- // 平台活动-订单
- const actOrder = {
- platform_act: { type: String, required: false, zh: '平台活动', ref: 'System.PlatformAct' }, //
- order_detail: { type: String, required: false, zh: '拆分后的订单', ref: 'Trade.Order' }, //
- is_deal: { type: String, required: false, default: '0', zh: '是否处理' }, // 字典:is_deal
- goods: { type: Array, required: false, zh: '影响的商品' }, //
- };
- const schema = new Schema(actOrder, { toJSON: { getters: true, virtuals: true } });
- schema.index({ id: 1 });
- schema.index({ 'meta.createdAt': 1 });
- schema.index({ platform_act: 1 });
- schema.index({ order_detail: 1 });
- schema.index({ is_deal: 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('ActOrder', schema, 'actOrder');
- };
|