活动:成长活动统计任务,领取奖励接口
This commit is contained in:
@@ -18,6 +18,18 @@ export default class Activity extends BaseModel {
|
||||
@prop({ required: true })
|
||||
data: string; // 活动表中的数据
|
||||
|
||||
//根据活动类型查询开启的活动数据
|
||||
public static async findOpenActivityByType(type: number, date: Date, lean = true) {
|
||||
let result: ActivityModelType[] = await ActivityModel.find({ type, beginTime: { $lte: date }, endTime: { $gte: date } }).lean(lean);
|
||||
return result;
|
||||
}
|
||||
|
||||
//根据活动类型查询活动数据
|
||||
public static async findActivityByType(type: number, lean = true) {
|
||||
let result: ActivityModelType[] = await ActivityModel.find({ type }).lean(lean);
|
||||
return result;
|
||||
}
|
||||
|
||||
//根据活动id查询活动数据
|
||||
public static async findActivity(acvitityId: number, lean = true) {
|
||||
let result: ActivityModelType = await ActivityModel.findOne({ acvitityId }).lean(lean);
|
||||
|
||||
Reference in New Issue
Block a user