解决 bug
This commit is contained in:
@ -266,7 +266,7 @@ func (s *sStore) DeleteIP(ctx context.Context, in *model.IPDeleteIn) (*model.IPD
|
||||
}
|
||||
|
||||
func (s *sStore) Detail(ctx context.Context, in *model.StoreDetailIn) (out *model.StoreDetailOut, err error) {
|
||||
one, err := dao.Stores.Ctx(ctx).Where(do.Stores{NetbarAccount: in.NetbarAccount}).One()
|
||||
one, err := dao.Stores.Ctx(ctx).Where(do.Stores{Id: in.StoreId}).One()
|
||||
if err != nil {
|
||||
return nil, ecode.Fail.Sub("查询门店出现异常")
|
||||
}
|
||||
@ -274,7 +274,8 @@ func (s *sStore) Detail(ctx context.Context, in *model.StoreDetailIn) (out *mode
|
||||
return nil, ecode.Params.Sub("门店不存在")
|
||||
}
|
||||
return &model.StoreDetailOut{
|
||||
Id: one[dao.Stores.Columns().Id].Int64(),
|
||||
Id: one[dao.Stores.Columns().Id].Int64(),
|
||||
NetbarAccount: one[dao.Stores.Columns().NetbarAccount].String(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@ -97,7 +97,11 @@ func (s *sStoreAdmin) Info(ctx context.Context, in *model.StoreAdminInfoIn) (out
|
||||
return nil, ecode.Fail.Sub("查询门店管理员失败")
|
||||
}
|
||||
out = &model.StoreAdminInfoOut{
|
||||
Username: storeAdmin.Username,
|
||||
Id: storeAdmin.Id,
|
||||
StoreId: storeAdmin.StoreId,
|
||||
Username: storeAdmin.Username,
|
||||
RealName: storeAdmin.RealName,
|
||||
IsPrimary: storeAdmin.IsPrimary,
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@ -523,10 +523,11 @@ func (s *sTask) GetTaskList(ctx context.Context, in *model.GetTaskListV2In) (out
|
||||
result.TaskList[i].Status = 1
|
||||
} else {
|
||||
// 存在用户记录,自行判断用户是否完成任务
|
||||
if v.UserTimes-one["user_times"].Int64() >= v.TargetTimes {
|
||||
completeTime := gtime.Now()
|
||||
userTaskStatus := one["status"].Int64()
|
||||
if userTaskStatus == 1 {
|
||||
userTaskStatus := one["status"].Int64()
|
||||
|
||||
if userTaskStatus == 1 {
|
||||
if v.UserTimes-one["user_times"].Int64() >= v.TargetTimes {
|
||||
completeTime := gtime.Now()
|
||||
if err := dao.UserTasks.Transaction(ctx, func(ctx context.Context, tx gdb.TX) (err error) {
|
||||
// 用户任务完成修改任务记录完成时间
|
||||
_, err = dao.UserTasks.Ctx(ctx).Where(do.UserTasks{UserId: in.UserId, TaskId: v.TaskID}).Data(do.UserTasks{CompletedAt: completeTime}).Update()
|
||||
@ -569,16 +570,17 @@ func (s *sTask) GetTaskList(ctx context.Context, in *model.GetTaskListV2In) (out
|
||||
return nil, err
|
||||
}
|
||||
result.TaskList[i].Status = 2
|
||||
} else if userTaskStatus == 3 {
|
||||
result.TaskList[i].Status = 2
|
||||
} else {
|
||||
result.TaskList[i].Status = 3
|
||||
result.TaskList[i].UserTimes -= one["user_times"].Int64()
|
||||
result.TaskList[i].Status = 1
|
||||
}
|
||||
} else if userTaskStatus == 3 {
|
||||
result.TaskList[i].Status = 2
|
||||
} else {
|
||||
result.TaskList[i].UserTimes -= one["user_times"].Int64()
|
||||
result.TaskList[i].Status = 1
|
||||
result.TaskList[i].Status = 3
|
||||
}
|
||||
result.TaskList[i].UserTaskId = one["id"].Int64()
|
||||
|
||||
}
|
||||
}
|
||||
out.PageIdx = result.PageIdx
|
||||
|
||||
Reference in New Issue
Block a user