Compare commits
3 Commits
1462018682
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 8f35548fe2 | |||
| 6aa28533bd | |||
| 7e93ce31a3 |
@ -54,6 +54,8 @@ func (c *ControllerV1) Callback(ctx context.Context, req *v1.CallbackReq) (res *
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glog.Infof(ctx, "回调响应:%s", marshal)
|
||||||
|
|
||||||
g.RequestFromCtx(ctx).Response.Write(marshal)
|
g.RequestFromCtx(ctx).Response.Write(marshal)
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,7 @@ func (c *ControllerV1) GetTaskList(ctx context.Context, req *v1.GetTaskListReq)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
glog.Infof(ctx, "The return task length of Game %d: %d", req.Gid, len(list.Data))
|
||||||
glog.Info(ctx, list)
|
glog.Info(ctx, list)
|
||||||
return &v1.GetTaskListRes{
|
return &v1.GetTaskListRes{
|
||||||
List: list,
|
List: list,
|
||||||
|
|||||||
@ -608,30 +608,30 @@ func (s *sReward) GetLift(ctx context.Context, in *model.GetRewardIn) (out *mode
|
|||||||
//if err2 != nil {
|
//if err2 != nil {
|
||||||
if err2 != nil && err2.Error() == "奖励领取超出限制,-1" {
|
if err2 != nil && err2.Error() == "奖励领取超出限制,-1" {
|
||||||
// 修改奖励领取状态为5
|
// 修改奖励领取状态为5
|
||||||
_, err2 = dao.UserTaskRewards.Ctx(ctx).Where(do.UserTaskRewards{Id: in.Id}).Data(do.UserTaskRewards{
|
//_, err2 = dao.UserTaskRewards.Ctx(ctx).Where(do.UserTaskRewards{Id: in.Id}).Data(do.UserTaskRewards{
|
||||||
Status: consts.RewardFailedStatus,
|
// Status: consts.RewardFailedStatus,
|
||||||
}).Update()
|
//}).Update()
|
||||||
|
//
|
||||||
if err2 != nil {
|
//if err2 != nil {
|
||||||
return nil, ecode.Fail.Sub("修改用奖励领取状态失败")
|
// return nil, ecode.Fail.Sub("修改用奖励领取状态失败")
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
// 判断奖励是否领完,修改用户任务记录为 2
|
//// 判断奖励是否领完,修改用户任务记录为 2
|
||||||
exist, err2 := dao.UserTaskRewards.Ctx(ctx).Where(do.UserTaskRewards{UserTaskId: in.UserTaskId}).WhereIn(dao.UserTaskRewards.Columns().Status, []int{2, 3}).Exist()
|
//exist, err2 := dao.UserTaskRewards.Ctx(ctx).Where(do.UserTaskRewards{UserTaskId: in.UserTaskId}).WhereIn(dao.UserTaskRewards.Columns().Status, []int{2, 3}).Exist()
|
||||||
if err2 != nil {
|
//if err2 != nil {
|
||||||
return nil, ecode.Fail.Sub("查询用户任务奖励失败")
|
// return nil, ecode.Fail.Sub("查询用户任务奖励失败")
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
if !exist {
|
//if !exist {
|
||||||
// 修改用户任务记录为 2
|
// // 修改用户任务记录为 2
|
||||||
_, err2 = dao.UserTasks.Ctx(ctx).Where(do.UserTasks{Id: in.UserTaskId}).Data(do.UserTasks{
|
// _, err2 = dao.UserTasks.Ctx(ctx).Where(do.UserTasks{Id: in.UserTaskId}).Data(do.UserTasks{
|
||||||
Status: 2,
|
// Status: 2,
|
||||||
}).Update()
|
// }).Update()
|
||||||
|
//
|
||||||
if err2 != nil {
|
// if err2 != nil {
|
||||||
return nil, ecode.Fail.Sub("修改用户任务状态失败")
|
// return nil, ecode.Fail.Sub("修改用户任务状态失败")
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
return nil, ecode.RewardExceedLimited
|
return nil, ecode.RewardExceedLimited
|
||||||
} else if err2 != nil {
|
} else if err2 != nil {
|
||||||
|
|||||||
@ -500,6 +500,7 @@ func (s *sTask) GetTaskList(ctx context.Context, in *model.GetTaskListV2In) (out
|
|||||||
if !ok {
|
if !ok {
|
||||||
return nil, ecode.Fail.Sub("数据类型转换失败")
|
return nil, ecode.Fail.Sub("数据类型转换失败")
|
||||||
}
|
}
|
||||||
|
glog.Infof(ctx, "The tencent task length of Game %d: %d", in.Gid, len(result.TaskList))
|
||||||
for i, v := range result.TaskList {
|
for i, v := range result.TaskList {
|
||||||
// 获取任务奖励列表
|
// 获取任务奖励列表
|
||||||
err := dao.TaskRewards.Ctx(ctx).Where(do.TaskRewards{TaskId: v.TaskID}).WhereOr(do.TaskRewards{TaskId: v.TaskID, NetbarAccount: in.NetBarAccount}).
|
err := dao.TaskRewards.Ctx(ctx).Where(do.TaskRewards{TaskId: v.TaskID}).WhereOr(do.TaskRewards{TaskId: v.TaskID, NetbarAccount: in.NetBarAccount}).
|
||||||
|
|||||||
Reference in New Issue
Block a user