|
@@ -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>
|