|
@@ -159,16 +159,16 @@ namespace GxPress.Repository.Implement.Navigation
|
|
|
if (string.IsNullOrEmpty(middleLable.LabelId))
|
|
|
return result;
|
|
|
result = _mapper.Map<MiddleLableResult>(middleLable);
|
|
|
- result.NavigationMediaResults = new List<NavigationMediaResult>();
|
|
|
+ result.NavigationLabelMediaResults = new List<NavigationLabelMediaResult>();
|
|
|
//获取轮播
|
|
|
if (middleLable.IsSlide)
|
|
|
{
|
|
|
if (result.IsSlide)
|
|
|
{
|
|
|
result.Sildes = await slideRepository.GetAllAsync(Q.Where(nameof(Entity.Slide.TypeId), result.TypeId).Where(nameof(Entity.Slide.IsDisable), false).OrderByDesc(nameof(Entity.Slide.Sort)));
|
|
|
- foreach (var item in result.Sildes)
|
|
|
+ foreach (var item in result.Sildes)
|
|
|
{
|
|
|
- item.ImageUrl=StringUtils.AddDomain(item.ImageUrl);
|
|
|
+ item.ImageUrl = StringUtils.AddDomain(item.ImageUrl);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -177,7 +177,7 @@ namespace GxPress.Repository.Implement.Navigation
|
|
|
var systemLabels = await _systemLabelRepository.GetAllAsync(Q.WhereIn(nameof(Entity.SystemLabel.SystemLabel.Id), StringUtils.StringCollectionToIntList(middleLable.LabelId)));
|
|
|
foreach (var item in systemLabels)
|
|
|
{
|
|
|
- var navigationMediaResult = new NavigationMediaResult()
|
|
|
+ var navigationLabelMediaResult = new NavigationLabelMediaResult()
|
|
|
{
|
|
|
Id = item.Id,
|
|
|
Sort = item.Sort,
|
|
@@ -192,22 +192,30 @@ namespace GxPress.Repository.Implement.Navigation
|
|
|
Remark = item.Remark
|
|
|
};
|
|
|
//获取媒体标签
|
|
|
- var mediaLables = await _mediaLableRepository.GetAllAsync(Q.Where(nameof(Entity.tede2.Media.MediaLable.LableId), item.Id));
|
|
|
+ var mediaLables = await _mediaLableRepository.GetAllAsync<int>(Q.Select(nameof(Entity.tede2.Media.MediaLable.MediaId)).Where(nameof(Entity.tede2.Media.MediaLable.LableId), item.Id));
|
|
|
//获取媒体
|
|
|
var query = Q.NewQuery();
|
|
|
- query.WhereIn(nameof(Entity.tede2.Media.Media.Id), mediaLables.Select(n => n.MediaId));
|
|
|
+ query.Select(nameof(Entity.tede2.Media.Media.Id));
|
|
|
+ query.Select(nameof(Entity.tede2.Media.Media.ImageUrls));
|
|
|
+ query.Select(nameof(Entity.tede2.Media.Media.Title));
|
|
|
+ query.Select(nameof(Entity.tede2.Media.Media.Summary));
|
|
|
+ query.Select(nameof(Entity.tede2.Media.Media.TeacherId));
|
|
|
+ query.Select(nameof(Entity.tede2.Media.Media.AutoNumber));
|
|
|
+ query.Select(nameof(Entity.tede2.Media.Media.Author));
|
|
|
+ query.Select(nameof(Entity.tede2.Media.Media.MediaType));
|
|
|
+ query.WhereIn(nameof(Entity.tede2.Media.Media.Id), mediaLables);
|
|
|
query.Where(nameof(Entity.tede2.Media.Media.IsChecked), true);
|
|
|
query.Where(nameof(Entity.tede2.Media.Media.IsDelete), false);
|
|
|
query.OrderByDesc(nameof(Entity.tede2.Media.Media.IsTop));
|
|
|
query.OrderByDesc(nameof(Entity.tede2.Media.Media.IsRecommend));
|
|
|
query.ForPage(1, 10);
|
|
|
- var medias = await _mediaRepository.GetAllAsync(query);
|
|
|
- navigationMediaResult.MediaResults = medias.Select(n => _mapper.Map<MediaResult>(n)).ToList();
|
|
|
- foreach (var itemMedia in navigationMediaResult.MediaResults)
|
|
|
+ var medias = await _mediaRepository.GetAllAsync<NavigationMediaResult>(query);
|
|
|
+ navigationLabelMediaResult.MediaResults = medias.ToList();
|
|
|
+ foreach (var itemMedia in navigationLabelMediaResult.MediaResults)
|
|
|
{
|
|
|
itemMedia.ImageUrls = StringUtils.AddDomain(itemMedia.ImageUrls);
|
|
|
}
|
|
|
- result.NavigationMediaResults.Add(navigationMediaResult);
|
|
|
+ result.NavigationLabelMediaResults.Add(navigationLabelMediaResult);
|
|
|
}
|
|
|
}
|
|
|
return result;
|