|
@@ -117,11 +117,14 @@ namespace Hotline.Api.Controllers
|
|
|
[HttpPost("getarticlelist")]
|
|
|
public async Task<OpenResponse> GetArticleList([FromBody] QueryArticleListDto dto)
|
|
|
{
|
|
|
+ if (string.IsNullOrEmpty(dto.PushRanges))
|
|
|
+ dto.PushRanges = "2";
|
|
|
+
|
|
|
RefAsync<int> total = 0;
|
|
|
var items = await _bulletinRepository.Queryable()
|
|
|
.Where(p => p.LoseEfficacyTime >= DateTime.Now)
|
|
|
.Where(p => p.IsArrive == true)
|
|
|
- .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", "2"))
|
|
|
+ .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", dto.PushRanges))
|
|
|
.Where(p => p.BulletinTypeId == dto.NoticeType)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Condition), p => p.Title.Contains(dto.Condition))
|
|
|
.OrderByDescending(p => p.CreationTime)
|
|
@@ -160,10 +163,13 @@ namespace Hotline.Api.Controllers
|
|
|
[HttpPost("getarticlelistbynum")]
|
|
|
public async Task<OpenResponse> GetArticleListByNum([FromBody] ArticleIdByNumDto dto)
|
|
|
{
|
|
|
+ if (string.IsNullOrEmpty(dto.PushRanges))
|
|
|
+ dto.PushRanges = "2";
|
|
|
+
|
|
|
var items = await _bulletinRepository.Queryable()
|
|
|
.Where(p => p.LoseEfficacyTime >= DateTime.Now)
|
|
|
.Where(p => p.IsArrive == true)
|
|
|
- .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", "2"))
|
|
|
+ .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", dto.PushRanges))
|
|
|
// .Where(p => p.BulletinTypeId == dto.BulletinTypeId)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.BulletinTypeId), p => p.BulletinTypeId == dto.BulletinTypeId)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.CheckChar), p => p.Content.Contains(dto.CheckChar))
|
|
@@ -269,10 +275,13 @@ namespace Hotline.Api.Controllers
|
|
|
[HttpPost("getpreviousandnext")]
|
|
|
public async Task<OpenResponse> GetPreviousAndNext([FromBody] ArticlePreviousAndNextDto dto)
|
|
|
{
|
|
|
+ if (string.IsNullOrEmpty(dto.PushRanges))
|
|
|
+ dto.PushRanges = "2";
|
|
|
+
|
|
|
var sugar = _bulletinRepository.Queryable()
|
|
|
.Where(p => p.LoseEfficacyTime >= DateTime.Now)
|
|
|
.Where(p => p.IsArrive == true)
|
|
|
- .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", "2"))
|
|
|
+ .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", dto.PushRanges))
|
|
|
;
|
|
|
if (dto.FullSearch == "1")//全文搜索
|
|
|
{
|
|
@@ -347,6 +356,9 @@ namespace Hotline.Api.Controllers
|
|
|
[HttpPost("getfulltextsearchlist")]
|
|
|
public async Task<OpenResponse> GetFullTextSearchList([FromBody] QueryArticleListDto dto)
|
|
|
{
|
|
|
+ if (string.IsNullOrEmpty(dto.PushRanges))
|
|
|
+ dto.PushRanges = "2";
|
|
|
+
|
|
|
if (string.IsNullOrEmpty(dto.Condition))
|
|
|
return OpenResponse.Ok(WebPortalDeResponse<FullTextSearchListDataDto>.Success(null));
|
|
|
|
|
@@ -354,7 +366,7 @@ namespace Hotline.Api.Controllers
|
|
|
var items = await _bulletinRepository.Queryable()
|
|
|
.Where(p => p.LoseEfficacyTime >= DateTime.Now)
|
|
|
.Where(p => p.IsArrive == true)
|
|
|
- .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", "2"))
|
|
|
+ .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", dto.PushRanges))
|
|
|
.WhereIF(_appOptions.Value.IsYiBin, p => p.BulletinTypeId == "1" || p.BulletinTypeId == "5" || p.BulletinTypeId == "6" || p.BulletinTypeId == "7" || p.BulletinTypeId == "3" || p.BulletinTypeId == "4")
|
|
|
.WhereIF(_appOptions.Value.IsZiGong, p => p.BulletinTypeId == "5013" || p.BulletinTypeId == "5016" || p.BulletinTypeId == "5011" || p.BulletinTypeId == "5015" || p.BulletinTypeId == "5017")
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Condition), p => p.Title.Contains(dto.Condition))
|