From 2c1bec379d46f7a1a10b3ac3ba46116f600f6bcc Mon Sep 17 00:00:00 2001 From: Putoo <290555932@qq.com> Date: Fri, 10 Jul 2026 19:30:46 +0800 Subject: [PATCH] 12121 --- .../Services/Service/Monster/GameMonsterService.cs | 4 +++- .../Services/Service/Task/GameTaskService.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Service/Application.Domain/Services/Service/Monster/GameMonsterService.cs b/Service/Application.Domain/Services/Service/Monster/GameMonsterService.cs index aba2a27..7bee7d7 100644 --- a/Service/Application.Domain/Services/Service/Monster/GameMonsterService.cs +++ b/Service/Application.Domain/Services/Service/Monster/GameMonsterService.cs @@ -168,7 +168,9 @@ public class GameMonsterService(ISqlSugarClient DbClient, IRedisCache redis) : I { var db = DbClient.AsTenant().GetConnectionWithAttr(); return await db.Queryable() - .Where(it => it.userId == userId && it.monsterId == monsterId && it.state == state).CountAsync(); + .Where(it => it.userId == userId && it.monsterId == monsterId) + .WhereIF(state != -1, it => it.state == state) + .CountAsync(); } diff --git a/Service/Application.Domain/Services/Service/Task/GameTaskService.cs b/Service/Application.Domain/Services/Service/Task/GameTaskService.cs index c1924a1..1440a07 100644 --- a/Service/Application.Domain/Services/Service/Task/GameTaskService.cs +++ b/Service/Application.Domain/Services/Service/Task/GameTaskService.cs @@ -245,7 +245,7 @@ public class GameTaskService(ISqlSugarClient DbClient, IRedisCache redis) : IGam if (!string.IsNullOrEmpty(item.mapId) && !string.IsNullOrEmpty(item.parameter)) { int opCount = 0; - int count = await monsterService.GetUserMonsterCount(userId, item.parameter, 0); + int count = await monsterService.GetUserMonsterCount(userId, item.parameter, -1); if (count < item.count) { opCount = (int)item.count - count;