Bladeren bron

公共惯用语 包含部门

田爽 4 maanden geleden
bovenliggende
commit
b01592aa1e
1 gewijzigde bestanden met toevoegingen van 3 en 2 verwijderingen
  1. 3 2
      src/Hotline.Api/Controllers/SysController.cs

+ 3 - 2
src/Hotline.Api/Controllers/SysController.cs

@@ -480,8 +480,9 @@ namespace Hotline.Api.Controllers
         [HttpGet("common-list")]
         public async Task<IReadOnlyList<SystemCommonOpinion>> GetCommon([FromQuery] ECommonType commonType, bool isOpen)
         {
-            return await _commonOpinionRepository.Queryable().Where(x => x.CommonType == commonType && (x.IsOpen == isOpen || (x.CreatorOrgId == _sessionContext.RequiredOrgId && x.AttributionType == ECommonAttributionType.Org)))
-                .WhereIF(isOpen == false, x => x.CreatorId == _sessionContext.RequiredUserId && x.AttributionType == ECommonAttributionType.User ).ToListAsync();
+            return await _commonOpinionRepository.Queryable().Where(x => x.CommonType == commonType )
+			    .WhereIF(isOpen == true, x =>(x.IsOpen == true || (x.CreatorOrgId == _sessionContext.RequiredOrgId && x.AttributionType == ECommonAttributionType.Org && x.IsOpen == false)))
+				.WhereIF(isOpen == false, x => x.IsOpen == false && x.CreatorId == _sessionContext.RequiredUserId).ToListAsync();
         }
 
         /// <summary>