活动:修改任务接口
This commit is contained in:
@@ -30,6 +30,14 @@ export default class Activity extends BaseModel {
|
||||
return result;
|
||||
}
|
||||
|
||||
//根据活动类型查询开启的活动数据
|
||||
public static async findOpenActivityByTypes(activityGroupId: number[], types: number[], date: Date) {
|
||||
let result: ActivityModelType[] = await ActivityModel.find(
|
||||
{ groupId: { $in: activityGroupId }, type: { $in: types }, beginTime: { $lte: date }, endTime: { $gte: date } }
|
||||
).sort({ activityId: -1 }).lean(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
//根据活动类型查询活动数据
|
||||
public static async findActivityByType(activityGroupId: number[], type: number, sort: number) {
|
||||
let result: ActivityModelType[] = await ActivityModel.find({ groupId: { $in: activityGroupId }, type }).sort({ activityId: sort }).lean(true);
|
||||
|
||||
@@ -63,6 +63,12 @@ export default class UserOrder extends BaseModel {
|
||||
return result;
|
||||
}
|
||||
|
||||
//查询成功订单详情
|
||||
public static async findSuccessOrderByProductID(productID: string, roleId: string, activityId: number) {
|
||||
let result: UserOrderModelType[] = await UserOrderModel.find({ productID, roleId, activityId, state: ORDER_STATE.RESULT_SUCCESS }).lean(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
//查询订单详情
|
||||
public static async findOrderByProductID(productID: string, roleId: string, activityId: number) {
|
||||
let result: UserOrderModelType[] = await UserOrderModel.find({ productID, roleId, activityId }).lean(true);
|
||||
|
||||
Reference in New Issue
Block a user