|
@@ -930,6 +930,17 @@ namespace GxPress.Repository.Implement.Media
|
|
|
query.Select(nameof(Entity.tede2.Media.Media.Summary));
|
|
|
query.Select(nameof(Entity.tede2.Media.Media.CommentScore));
|
|
|
query.WhereIn(nameof(Entity.tede2.Media.Media.Id), request.Ids);
|
|
|
+ //最热
|
|
|
+ if (request.SortSift == 1)
|
|
|
+ query.OrderByDesc(nameof(Entity.tede2.Media.Media.ReadCount));
|
|
|
+ //最新
|
|
|
+ if (request.SortSift == 2)
|
|
|
+ query.OrderByDesc(nameof(Entity.tede2.Media.Media.CreatedDate));
|
|
|
+ //好评
|
|
|
+ if (request.SortSift == 3)
|
|
|
+ query.OrderByDesc(nameof(Entity.tede2.Media.Media.CommentScore));
|
|
|
+ if (request.PressSift.Count() > 0)
|
|
|
+ query.WhereIn(nameof(Entity.tede2.Media.Media.Press), request.PressSift);
|
|
|
if (!string.IsNullOrEmpty(request.KeyWord))
|
|
|
query.WhereLike(nameof(Entity.tede2.Media.Media.Title), $"%{request.KeyWord}%");
|
|
|
resut.Total = await _repository.CountAsync(query);
|
|
@@ -946,5 +957,18 @@ namespace GxPress.Repository.Implement.Media
|
|
|
item.ImageUrls = StringUtils.AddDomain(item.ImageUrls);
|
|
|
return resut;
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 获取出版社
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<IEnumerable<string>> GetPresssAsync()
|
|
|
+ {
|
|
|
+ var query = Q.NewQuery();
|
|
|
+ query.Where(nameof(Entity.tede2.Media.Media.Id), ">", 0);
|
|
|
+ query.GroupBy(nameof(Entity.tede2.Media.Media.Press));
|
|
|
+ query.Select(nameof(Entity.tede2.Media.Media.Press));
|
|
|
+ query.Where(nameof(Entity.tede2.Media.Media.Press), "<>", "");
|
|
|
+ return await _repository.GetAllAsync<string>(query);
|
|
|
+ }
|
|
|
}
|
|
|
}
|