From 95fc054231924435a0d066ba2920dc946b98507b Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Thu, 29 May 2025 14:51:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B2=97=E4=BD=8D=E8=AF=BE=E7=A8=8B=E7=9F=A9?= =?UTF-8?q?=E9=98=B5=E6=96=B0=E5=A2=9E=E9=9B=86=E5=9B=A2=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BD=92=E5=B1=9E=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tiobon.Core.Services/Ghra/Ghra_TitleServices.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Tiobon.Core.Services/Ghra/Ghra_TitleServices.cs b/Tiobon.Core.Services/Ghra/Ghra_TitleServices.cs index 53626057..21a6bbf3 100644 --- a/Tiobon.Core.Services/Ghra/Ghra_TitleServices.cs +++ b/Tiobon.Core.Services/Ghra/Ghra_TitleServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.Common; -using static StackExchange.Redis.Role; - -namespace Tiobon.Core.Services; +namespace Tiobon.Core.Services; /// /// 岗位 (服务) @@ -31,10 +28,10 @@ public class Ghra_TitleServices : BaseServices(); + var ruleSrc = Db.Queryable().Where($"dbo.FUserDataBelongPriv ({App.User.ID}, DataBelongID, NULL) = 1"); if (string.IsNullOrWhiteSpace(filter.orderBy)) filter.orderBy = "Type ASC"; - string sql = $"SELECT * FROM Ghre_CourseScene_V WHERE IsEnable=1"; + string sql = $"SELECT *\r\nFROM Ghre_CourseScene_V\r\nWHERE IsEnable = 1 AND dbo.FUserDataBelongPriv ({App.User.ID}, DataBelongID, NULL) = 1 "; var rules1 = await ruleSrc.Where(x => x.RuleType == "Required" && x.TrainType == "Title").ToListAsync(); var rules = Mapper.Map(rules1).ToANew>(); @@ -54,7 +51,7 @@ public class Ghra_TitleServices : BaseServices>(x.GradeId); }); - var titles = await Db.Queryable().OrderBy(x => x.SortNo).ToListAsync(); + var titles = await Db.Queryable().Where($"dbo.FUserDataBelongPriv ({App.User.ID}, DataBelongID, NULL) = 1").OrderBy(x => x.SortNo).ToListAsync(); #region 处理查询条件 //Expression> whereExpression = new Expression>();