新增获取门店网费奖励信息列表
This commit is contained in:
@ -1213,3 +1213,32 @@ func (s *sReward) NetfeeCallback(ctx context.Context, in *model.NetfeeCallbackIn
|
||||
|
||||
return &model.NetfeeCallbackOut{Success: true}, nil
|
||||
}
|
||||
|
||||
func (s *sReward) GetNetfeeList(ctx context.Context, in *model.NetfeeListIn) (out *model.NetfeeListOut, err error) {
|
||||
|
||||
// 查询奖励类型为网费的奖励 id
|
||||
value, err := dao.RewardTypes.Ctx(ctx).Where(do.RewardTypes{Code: "internet_fee"}).Fields(dao.RewardTypes.Columns().Id).Value()
|
||||
if err != nil {
|
||||
return nil, ecode.Fail.Sub("查询奖励类型id失败")
|
||||
}
|
||||
|
||||
if value.IsEmpty() {
|
||||
return nil, ecode.Fail.Sub("查询奖励类型id为空")
|
||||
}
|
||||
|
||||
var data []model.NetfeeRewards
|
||||
var total int
|
||||
m := dao.Rewards.Ctx(ctx)
|
||||
if in.StartTime != nil && in.EndTime != nil {
|
||||
m = m.WhereBetween(dao.Rewards.Columns().UpdatedAt, in.StartTime, in.EndTime)
|
||||
}
|
||||
|
||||
if err = m.Page(in.Page, in.Size).Where(do.Rewards{RewardTypeId: value.Int64(), StoreId: in.StoreId}).WithAll().ScanAndCount(&data, &total, false); err != nil {
|
||||
return nil, ecode.Fail.Sub("查询网费奖励列表失败")
|
||||
}
|
||||
|
||||
return &model.NetfeeListOut{
|
||||
List: data,
|
||||
Total: total,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -721,7 +721,6 @@ func (s *sTask) GetTaskList(ctx context.Context, in *model.GetTaskListV2In) (out
|
||||
TaskName: v.Title,
|
||||
GameId: in.Gid,
|
||||
TaskType: v.GameTaskConfig.TimeType,
|
||||
CompletedAt: completedTime,
|
||||
}).InsertAndGetId()
|
||||
if err != nil {
|
||||
return ecode.Fail.Sub("创建用户任务记录失败")
|
||||
|
||||
Reference in New Issue
Block a user