From f862be6d9e2e53745f1aa1c2f2946d5158b82224 Mon Sep 17 00:00:00 2001 From: chy <2463300564@qq.com> Date: Wed, 25 Jun 2025 11:57:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=A5=96=E5=8A=B1=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/logic/reward/reward.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/logic/reward/reward.go b/internal/logic/reward/reward.go index 9b27481..2b4f29d 100644 --- a/internal/logic/reward/reward.go +++ b/internal/logic/reward/reward.go @@ -488,12 +488,11 @@ func (s *sReward) OperateTaskReward(ctx context.Context, in *model.OperateTaskRe return nil, ecode.Params.Sub("奖励不存在") } - opiton := dao.TaskRewards.Ctx(ctx).Data(do.TaskRewards{TaskId: in.TaskId, RewardId: in.RewardId}) if in.Type == 1 { - _, err := opiton.Insert() + _, err := dao.TaskRewards.Ctx(ctx).Data(do.TaskRewards{TaskId: in.TaskId, RewardId: in.RewardId}).Insert() return &model.OperateTaskRewardOut{Success: true}, err } else { - _, err := opiton.Delete() + _, err := dao.TaskRewards.Ctx(ctx).Where(do.TaskRewards{TaskId: in.TaskId, RewardId: in.RewardId}).Delete() return &model.OperateTaskRewardOut{Success: true}, err } }