软质押任务修改
This commit is contained in:
@@ -36,6 +36,35 @@ func (l *GetTaskListLogic) GetTaskList(uid int, req *types.GetTaskListReq) (*typ
|
||||
return nil, errs.New(errs.ErrDatabaseOperate, err)
|
||||
}
|
||||
|
||||
if uid == 0 {
|
||||
resp := &types.GetTaskListResp{}
|
||||
for _, t := range tasks {
|
||||
var totalCount = 1
|
||||
if t.Param != "" {
|
||||
totalCount = cast.ToInt(t.Param)
|
||||
}
|
||||
|
||||
resp.Tasks = append(resp.Tasks, types.Task{
|
||||
Id: t.Id,
|
||||
Title: t.Title,
|
||||
SubTitle: t.SubTitle,
|
||||
Description: t.Description,
|
||||
Points: t.Points,
|
||||
ButtonText: t.ButtonText,
|
||||
Params: t.Param,
|
||||
Type: t.Type,
|
||||
Url: t.Url,
|
||||
StartAt: t.StartAt.Time.Format(time.DateTime),
|
||||
EndAt: t.EndAt.Time.Format(time.DateTime),
|
||||
Sort: t.Sort,
|
||||
HasFinishCount: 0,
|
||||
TotalCount: totalCount,
|
||||
FinishState: model.TASK_PROGRESS_NOT_FINISHED,
|
||||
})
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
count, err := l.svcCtx.PromoteBindModel.UserInviteCount(l.ctx, uint(uid))
|
||||
if err != nil {
|
||||
l.Errorw("get user invite count failed", logx.Field("err", err), logx.Field("uid", uid))
|
||||
|
||||
Reference in New Issue
Block a user