|
@@ -26,8 +26,9 @@ namespace Admin.Core.Service.Admin.Dictionary
|
|
public async Task<IResponseOutput> PageAsync(PageInput<DictionaryEntity> input)
|
|
public async Task<IResponseOutput> PageAsync(PageInput<DictionaryEntity> input)
|
|
{
|
|
{
|
|
var key = input.Filter?.Name;
|
|
var key = input.Filter?.Name;
|
|
-
|
|
|
|
|
|
+ var dictionaryTypeId = input.Filter?.DictionaryTypeId;
|
|
var list = await _dictionaryRepository.Select
|
|
var list = await _dictionaryRepository.Select
|
|
|
|
+ .WhereIf(dictionaryTypeId.HasValue && dictionaryTypeId.Value > 0, a => a.DictionaryTypeId == dictionaryTypeId)
|
|
.WhereIf(key.NotNull(), a => a.Name.Contains(key) || a.Code.Contains(key))
|
|
.WhereIf(key.NotNull(), a => a.Name.Contains(key) || a.Code.Contains(key))
|
|
.Count(out var total)
|
|
.Count(out var total)
|
|
.OrderByDescending(true, c => c.Id)
|
|
.OrderByDescending(true, c => c.Id)
|