|
@@ -154,8 +154,12 @@ namespace GxPress.Repository.Implement.Media
|
|
|
{
|
|
|
var result = new PagedList<Entity.tede2.Media.Media>();
|
|
|
var query = Q.NewQuery();
|
|
|
- query.Where(nameof(Entity.tede2.Media.Media.IsDelete), request.IsDelete);
|
|
|
- query.Where(nameof(Entity.tede2.Media.Media.MediaType), request.MediaType);
|
|
|
+ if (request.IsDelete > 0)
|
|
|
+ query.Where(nameof(Entity.tede2.Media.Media.IsDelete), request.IsDelete);
|
|
|
+ if (request.MediaType > 0)
|
|
|
+ query.Where(nameof(Entity.tede2.Media.Media.MediaType), request.MediaType);
|
|
|
+ if (request.LibraryType > 0)
|
|
|
+ query.Where(nameof(Entity.tede2.Media.Media.IsLibrary), request.LibraryType == 1);
|
|
|
result.Total = await _repository.CountAsync(query);
|
|
|
var item = await _repository.GetAllAsync(query.ForPage(request.Page, request.PerPage).OrderByDesc(nameof(Entity.tede2.Media.Media.Sort)));
|
|
|
result.Items = item;
|