Merge remote-tracking branch 'origin/master'
This commit is contained in:
@ -371,10 +371,10 @@ func (s *sTask) GetTask(ctx context.Context, in *model.GetTaskIn) (out *model.Ge
|
||||
start := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location())
|
||||
// 当天结束时间
|
||||
end := time.Date(now.Year(), now.Month(), now.Day(), 23, 59, 59, 0, now.Location())
|
||||
err = dao.UserTasks.Ctx(ctx).Where(do.UserTasks{UserId: in.UserId, TaskId: in.TaskId, StoreId: storeId, GameId: in.GameId}).
|
||||
err = dao.UserTasks.Ctx(ctx).Where(do.UserTasks{UserId: in.UserId, TaskId: in.TaskId, StoreId: storeId, GameId: in.GameId, BindType: in.BindType}).
|
||||
WhereBetween(dao.UserTasks.Columns().CreatedAt, start, end).Scan(&userTask)
|
||||
} else {
|
||||
err = dao.UserTasks.Ctx(ctx).Where(do.UserTasks{UserId: in.UserId, TaskId: in.TaskId, StoreId: storeId, GameId: in.GameId}).Scan(&userTask)
|
||||
err = dao.UserTasks.Ctx(ctx).Where(do.UserTasks{UserId: in.UserId, TaskId: in.TaskId, StoreId: storeId, GameId: in.GameId, BindType: in.BindType}).Scan(&userTask)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
@ -403,6 +403,7 @@ func (s *sTask) GetTask(ctx context.Context, in *model.GetTaskIn) (out *model.Ge
|
||||
GameId: in.GameId,
|
||||
TaskType: in.TaskType,
|
||||
UserTimes: in.UserTimes,
|
||||
BindType: in.BindType,
|
||||
})
|
||||
if err != nil {
|
||||
return ecode.Fail.Sub("创建用户任务记录失败")
|
||||
@ -445,7 +446,7 @@ func (s *sTask) GetTask(ctx context.Context, in *model.GetTaskIn) (out *model.Ge
|
||||
func (s *sTask) GetUserTaskRecordsList(ctx context.Context, in *model.UserTaskRecordsListIn) (out *model.UserTaskRecordsListOut, err error) {
|
||||
list := make([]model.UserTask2, 0)
|
||||
var total int
|
||||
orm := dao.UserTasks.Ctx(ctx).Where(dao.UserTasks.Columns().UserId, in.UserId)
|
||||
orm := dao.UserTasks.Ctx(ctx).Where(dao.UserTasks.Columns().UserId, in.UserId, dao.UserTasks.Columns().BindType, in.BindType)
|
||||
|
||||
if in.StoreId != 0 && in.NetBarAccount == "" {
|
||||
orm = orm.Where(dao.UserTasks.Columns().StoreId, in.StoreId)
|
||||
@ -503,7 +504,7 @@ func (s *sTask) GetTaskList(ctx context.Context, in *model.GetTaskListV2In) (out
|
||||
if err != nil {
|
||||
return nil, ecode.Fail.Sub("获取任务奖励列表失败")
|
||||
}
|
||||
orm := dao.UserTasks.Ctx(ctx).Where(do.UserTasks{UserId: in.UserId, TaskId: v.TaskID})
|
||||
orm := dao.UserTasks.Ctx(ctx).Where(do.UserTasks{UserId: in.UserId, TaskId: v.TaskID, BindType: in.BindType})
|
||||
if v.GameTaskConfig.TimeType == 1 {
|
||||
// 每日任务
|
||||
start := gtime.Now().StartOfDay()
|
||||
|
||||
Reference in New Issue
Block a user