|
@@ -53,10 +53,19 @@ namespace GxPress.Repository.Implement.Navigation
|
|
|
{
|
|
|
return await _repository.UpdateAsync(query) > 0;
|
|
|
}
|
|
|
-
|
|
|
- public async Task<IEnumerable<Entity.Navigations.Navigation>> GetAllAsync()
|
|
|
+ /// <summary>
|
|
|
+ /// 获取 pc 或者移动端
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="terminal"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<IEnumerable<Entity.Navigations.Navigation>> GetAllAsync(int terminal)
|
|
|
{
|
|
|
- return await _repository.GetAllAsync(Q.Where(nameof(Entity.Navigations.Navigation.IsDisable), false).OrderByDesc(nameof(Entity.Navigations.Navigation.Sort)));
|
|
|
+ var query = Q.NewQuery();
|
|
|
+ if (terminal > 0)
|
|
|
+ query.Where(nameof(Entity.Navigations.Navigation.Terminal), terminal);
|
|
|
+ query.Where(nameof(Entity.Navigations.Navigation.IsDisable), false);
|
|
|
+ query.OrderByDesc(nameof(Entity.Navigations.Navigation.Sort));
|
|
|
+ return await _repository.GetAllAsync(query);
|
|
|
}
|
|
|
}
|
|
|
}
|