软质押任务修改

This commit is contained in:
lianghuanjie
2025-01-08 16:02:11 +08:00
parent 6dea53e53c
commit 29abba438c
11 changed files with 187 additions and 38 deletions

View File

@@ -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))