|
@@ -1,13 +1,19 @@
|
|
'use strict';
|
|
'use strict';
|
|
const Schema = require('mongoose').Schema;
|
|
const Schema = require('mongoose').Schema;
|
|
const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
|
|
const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
|
|
|
|
+const act = {
|
|
|
|
+ // 套装: 需要找到套装的商品,统一归为一个商品
|
|
|
|
+ platform_act: { type: String, zh: '活动id' },
|
|
|
|
+ set_id: { type: String, zh: '参加套装活动的商品组合数据id' },
|
|
|
|
|
|
|
|
+};
|
|
// 购物车
|
|
// 购物车
|
|
const cart = {
|
|
const cart = {
|
|
customer: { type: String, required: false, zh: '顾客', ref: 'User.User' }, //
|
|
customer: { type: String, required: false, zh: '顾客', ref: 'User.User' }, //
|
|
shop: { type: String, required: false, zh: '店铺', ref: 'Shop.Shop' }, //
|
|
shop: { type: String, required: false, zh: '店铺', ref: 'Shop.Shop' }, //
|
|
goods: { type: String, required: false, zh: '商品', ref: 'Shop.Goods' }, //
|
|
goods: { type: String, required: false, zh: '商品', ref: 'Shop.Goods' }, //
|
|
goodsSpec: { type: String, required: false, zh: '商品规格', ref: 'Shop.GoodsSpec' }, //
|
|
goodsSpec: { type: String, required: false, zh: '商品规格', ref: 'Shop.GoodsSpec' }, //
|
|
|
|
+ act: { type: Array, zh: '活动相关' },
|
|
num: { type: Number, required: false, zh: '数量' }, //
|
|
num: { type: Number, required: false, zh: '数量' }, //
|
|
};
|
|
};
|
|
const schema = new Schema(cart, { toJSON: { getters: true, virtuals: true } });
|
|
const schema = new Schema(cart, { toJSON: { getters: true, virtuals: true } });
|