活动:糜家商队

This commit is contained in:
qiaoxin
2021-06-08 17:36:44 +08:00
parent c51997299c
commit cc218151e4
12 changed files with 659 additions and 361 deletions

View File

@@ -19,16 +19,12 @@ export default class Activity_Self_Service_Shop extends BaseModel {
@prop({ required: true })
index: number; // 第几个货架从1开始
@prop({ required: true })
price: number; //购买价格
@prop({ required: true })
priceType: number; //1.虚拟货币2.RMB
@prop({ required: true })
goods: string; // 商品信息
//添加购买记录
public static async addBuyRecord(serverId: number, activityId: number, roleId: string, roundIndex: number, index: number, price: number, priceType: number, goods: string) {
public static async addBuyRecord(serverId: number, activityId: number, roleId: string, roundIndex: number, index: number, goods: string) {
await ActivitySelfServiceShopModel.insertMany([
{ serverId, roleId, activityId, roundIndex, index, price, priceType, goods }
{ serverId, roleId, activityId, roundIndex, index, goods }
])
}
@@ -45,8 +41,8 @@ export default class Activity_Self_Service_Shop extends BaseModel {
}
//查询购买价格类型的数据
public static async findDataByPriceType(serverId: number, activityId: number, roleId: string, roundIndex: number, priceType: number, lean = true) {
let result: ActivitySelfServiceShopModelType[] = await ActivitySelfServiceShopModel.find({ serverId, roleId, activityId, priceType, roundIndex }).lean(lean);
public static async findDataByPriceType(serverId: number, activityId: number, roleId: string, roundIndex: number, lean = true) {
let result: ActivitySelfServiceShopModelType[] = await ActivitySelfServiceShopModel.find({ serverId, roleId, activityId, roundIndex }).lean(lean);
return result;
}