From 11a90f15b2d9aec7c8dbe8d60a2b6f516a0752e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?old=E6=98=93?= <156663459@qq.com> Date: Thu, 21 Nov 2024 13:50:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=97=A0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- New_College.Api/Controllers/Front/LibraryController.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/New_College.Api/Controllers/Front/LibraryController.cs b/New_College.Api/Controllers/Front/LibraryController.cs index 297d37e..b621b6b 100644 --- a/New_College.Api/Controllers/Front/LibraryController.cs +++ b/New_College.Api/Controllers/Front/LibraryController.cs @@ -55,6 +55,16 @@ namespace New_College.Api.Controllers.Front var biaozhun = await _ScoreLineServices.Query(c => (c.Score == queryDto.Score.ToString() || c.Score == (queryDto.Score - 1).ToString()) && c.Province == queryDto.Pronvice && c.Years == queryDto.Years); var lines = biaozhun.Select(s => s.SumCount).ToArray(); + if (biaozhun.Count() <= 0) + { + + return new MessageModel>() + { + success = false, + msg = "暂无数据", + status = 200 + }; + } var query = await _ScoreLineServices.Query(c => SqlFunc.Between(c.SumCount, lines.Min(), lines.Max()) && c.Province == queryDto.Pronvice); //var newscore = queryDto.Score - 1; //var tmpquery = await _ScoreLineServices.Query(c => c.Score == newscore.ToString() && c.Province == queryDto.Pronvice);