From 65c71c574bbf04b049e9b2b1010aa01a18d4945a Mon Sep 17 00:00:00 2001 From: denghui <1016848185@qq.com> Date: Thu, 10 Jul 2025 15:42:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=BB=E5=8A=A1=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=9D=A1=E4=BB=B6=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/logic/task/task.go | 5 ++++- internal/model/userTask.go | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/internal/logic/task/task.go b/internal/logic/task/task.go index 252bf54..d7547ee 100644 --- a/internal/logic/task/task.go +++ b/internal/logic/task/task.go @@ -446,8 +446,11 @@ 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, dao.UserTasks.Columns().BindType, in.BindType) + orm := dao.UserTasks.Ctx(ctx).Where(dao.UserTasks.Columns().UserId, in.UserId) + if in.BindType != 0 { + orm = orm.Where(dao.UserTasks.Columns().BindType, in.BindType) + } if in.StoreId != 0 && in.NetBarAccount == "" { orm = orm.Where(dao.UserTasks.Columns().StoreId, in.StoreId) } diff --git a/internal/model/userTask.go b/internal/model/userTask.go index c8335fe..2d71a8b 100644 --- a/internal/model/userTask.go +++ b/internal/model/userTask.go @@ -33,9 +33,10 @@ type TaskReward struct { } type UserTask2 struct { - Id int64 `json:"id" orm:"id" description:"用户任务唯一标识符"` // 用户任务唯一标识符 - UserId int64 `json:"userId" orm:"user_id" description:"用户ID"` // 用户ID - TaskId string `json:"taskId" orm:"task_id" description:"腾讯任务ID"` // 腾讯任务ID + Id int64 `json:"id" orm:"id" description:"用户任务唯一标识符"` // 用户任务唯一标识符 + UserId int64 `json:"userId" orm:"user_id" description:"用户ID"` // 用户ID + TaskId string `json:"taskId" orm:"task_id" description:"腾讯任务ID"` // 腾讯任务ID + BindType int `json:"bindType" orm:"bind_type"` Status int `json:"status" orm:"status" description:"任务状态:1=进行中,2=已完成中,3=未完成"` // 任务状态:1=进行中(显示领取按钮),2=已完成 SerialNumber string `json:"serialNumber" orm:"serial_number" description:"流水号,确保用户任务唯一性"` // 流水号,确保用户任务唯一性 CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间