调整用户可领奖励列表和 用户任务记录列表接口
This commit is contained in:
@ -411,10 +411,22 @@ func (s *sTask) GetUserTaskRecordsList(ctx context.Context, in *model.UserTaskRe
|
||||
var total int
|
||||
orm := dao.UserTasks.Ctx(ctx).Where(dao.UserTasks.Columns().UserId, in.UserId)
|
||||
|
||||
if in.StoreId != 0 {
|
||||
if in.StoreId != 0 && in.NetBarAccount == "" {
|
||||
orm = orm.Where(dao.UserTasks.Columns().StoreId, in.StoreId)
|
||||
}
|
||||
err = orm.Page(in.Page, in.Size).WithAll().ScanAndCount(&list, &total, false)
|
||||
if in.NetBarAccount != "" && in.StoreId == 0 {
|
||||
value, err := dao.Stores.Ctx(ctx).Where(do.Stores{NetbarAccount: in.NetBarAccount}).Fields(dao.Stores.Columns().Id).Value()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
orm = orm.Where(dao.UserTasks.Columns().StoreId, value.Int())
|
||||
}
|
||||
|
||||
if in.GameId != 0 {
|
||||
orm = orm.Where(dao.UserTasks.Columns().GameId, in.GameId)
|
||||
}
|
||||
|
||||
err = orm.Page(in.Page, in.Size).ScanAndCount(&list, &total, false)
|
||||
if err != nil {
|
||||
return nil, ecode.Fail.Sub("获取用户任务列表失败")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user