|
@@ -30,7 +30,6 @@ namespace GxPress.Repository.Implement.SystemLabel
|
|
|
_mapper = mapper;
|
|
|
mediaLableRepository = new Repository<Entity.tede2.Media.MediaLable>(database);
|
|
|
}
|
|
|
-
|
|
|
public IDatabase Database => _repository.Database;
|
|
|
public string TableName => _repository.TableName;
|
|
|
public List<TableColumn> TableColumns => _repository.TableColumns;
|
|
@@ -82,6 +81,8 @@ namespace GxPress.Repository.Implement.SystemLabel
|
|
|
model.IsShowLabelName = request.IsShowLabelName == 1;
|
|
|
if (request.PageSize > 0)
|
|
|
model.PageSize = request.PageSize;
|
|
|
+ if (request.IsStarLable > 0)
|
|
|
+ model.IsStarLable = request.IsStarLable == 1;
|
|
|
return await _repository.UpdateAsync(model);
|
|
|
}
|
|
|
return false;
|
|
@@ -90,12 +91,41 @@ namespace GxPress.Repository.Implement.SystemLabel
|
|
|
{
|
|
|
return await _repository.UpdateAsync(query) > 0;
|
|
|
}
|
|
|
-
|
|
|
+ /// <summary>
|
|
|
+ /// 获取标签
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="request"></param>
|
|
|
+ /// <returns></returns>
|
|
|
public async Task<PagedList<SystemLabelResult>> GetAllPageAsync(Common.Page.PageParameter request)
|
|
|
{
|
|
|
var result = new PagedList<SystemLabelResult>();
|
|
|
var query = Q.NewQuery();
|
|
|
query.Where(nameof(Entity.SystemLabel.SystemLabel.IsDisable), false);
|
|
|
+ query.Where(nameof(Entity.SystemLabel.SystemLabel.IsStarLable), false);
|
|
|
+ result.Total = await _repository.CountAsync(query);
|
|
|
+ query.OrderByDesc(nameof(Entity.Navigations.Navigation.Sort));
|
|
|
+ query.ForPage(request.Page, request.PerPage);
|
|
|
+ result.Items = await _repository.GetAllAsync<SystemLabelResult>(query);
|
|
|
+ foreach (var item in result.Items)
|
|
|
+ {
|
|
|
+ query = Q.NewQuery();
|
|
|
+ query.Where(nameof(Entity.tede2.Media.MediaLable.LableId), item.Id);
|
|
|
+ //获取资源数量
|
|
|
+ item.ResourceCount = await mediaLableRepository.CountAsync(query);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 获取明栏
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="request"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<PagedList<SystemLabelResult>> GetAllStarLablePageAsync(Common.Page.PageParameter request)
|
|
|
+ {
|
|
|
+ var result = new PagedList<SystemLabelResult>();
|
|
|
+ var query = Q.NewQuery();
|
|
|
+ query.Where(nameof(Entity.SystemLabel.SystemLabel.IsDisable), false);
|
|
|
+ query.Where(nameof(Entity.SystemLabel.SystemLabel.IsStarLable), true);
|
|
|
result.Total = await _repository.CountAsync(query);
|
|
|
query.OrderByDesc(nameof(Entity.Navigations.Navigation.Sort));
|
|
|
query.ForPage(request.Page, request.PerPage);
|
|
@@ -109,11 +139,25 @@ namespace GxPress.Repository.Implement.SystemLabel
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 获取明栏
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<IEnumerable<SystemLabelResult>> GetStarLableAllAsync()
|
|
|
+ {
|
|
|
+ var query = Q.NewQuery();
|
|
|
+ query.Where(nameof(Entity.SystemLabel.SystemLabel.IsDisable), false);
|
|
|
+ query.Where(nameof(Entity.SystemLabel.SystemLabel.IsStarLable), true);
|
|
|
+ query.OrderByDesc(nameof(Entity.Navigations.Navigation.Sort));
|
|
|
+ var result = await _repository.GetAllAsync<SystemLabelResult>(query);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
public async Task<IEnumerable<SystemLabelResult>> GetAllAsync()
|
|
|
{
|
|
|
var query = Q.NewQuery();
|
|
|
query.Where(nameof(Entity.SystemLabel.SystemLabel.IsDisable), false);
|
|
|
query.OrderByDesc(nameof(Entity.Navigations.Navigation.Sort));
|
|
|
+ query.Where(nameof(Entity.SystemLabel.SystemLabel.IsStarLable), false);
|
|
|
var result = await _repository.GetAllAsync<SystemLabelResult>(query);
|
|
|
return result;
|
|
|
}
|
|
@@ -121,7 +165,5 @@ namespace GxPress.Repository.Implement.SystemLabel
|
|
|
{
|
|
|
return await _repository.GetAllAsync(Q.WhereIn(nameof(Entity.SystemLabel.SystemLabel.Id), ids));
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|