From a671df3c25217bf4818e586e024b36769c64c0e5 Mon Sep 17 00:00:00 2001 From: cjy Date: Wed, 22 Oct 2025 16:04:05 +0800 Subject: [PATCH] =?UTF-8?q?bugfix=20:=20=E4=BF=AE=E6=94=B9=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E6=8F=90=E7=A4=BA=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/dao/taskDao.go | 6 +++--- internal/logic/taskLogic.go | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/internal/dao/taskDao.go b/internal/dao/taskDao.go index c92e450..5cee10d 100644 --- a/internal/dao/taskDao.go +++ b/internal/dao/taskDao.go @@ -693,15 +693,15 @@ func UpdatePendingCount(req *UpdatePendingCountRequest) error { if req.PendingVideoCount > bundleVideo+increaseVideo+manualVideo { tx.Rollback() - return commonErr.ReturnError(nil, "可用视频数不足", "扣减视频数量超过当前余额") + return commonErr.ReturnError(nil, "请输入正确的本次任务数字", "扣减视频数量超过当前余额") } if req.PendingPostCount > bundleImage+increaseImage+manualImage { tx.Rollback() - return commonErr.ReturnError(nil, "可用图文数不足", "扣减图文数量超过当前余额") + return commonErr.ReturnError(nil, "请输入正确的本次任务数字", "扣减图文数量超过当前余额") } if req.PendingDataCount > bundleData+increaseData+manualData { tx.Rollback() - return commonErr.ReturnError(nil, "可用数据分析数不足", "扣减数据分析数量超过当前余额") + return commonErr.ReturnError(nil, "请输入正确的本次任务数字", "扣减数据分析数量超过当前余额") } // 扣减视频:优先 会过期限制(套餐→增值) → 不过期限制(套餐→增值) → 非限制套餐 → 非限制增值 → 手动 diff --git a/internal/logic/taskLogic.go b/internal/logic/taskLogic.go index 8dfb5ce..89e1d4d 100644 --- a/internal/logic/taskLogic.go +++ b/internal/logic/taskLogic.go @@ -201,6 +201,11 @@ func AssignTask(req *dao.TaskAssignRequest) error { // UpdatePendingCount 修改待发数量 func UpdatePendingCount(req *dao.UpdatePendingCountRequest) error { + // 待发视频数、图文数、数据分析数不能都为0 + if req.PendingVideoCount == 0 && req.PendingPostCount == 0 && req.PendingDataCount == 0 { + return commonErr.ReturnError(nil, "请输入正确的本次任务数字", "待发视频数、图文数、数据分析数不能都为0") + } + // 1. 验证艺人是否有有效套餐 validArtistIDs, err := GetValidArtistIDs() if err != nil {