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;