【新增】增加商品列表dto类及查询方法,首页【商品组件】【商品tab组】【仿点餐界面】【栏目列表页】【推荐商品列表】进行替换。

【优化】优化普通商品及营销商品内页不同dom之间间距。微调其他页面样式
【调整】移除.net5升级到.net6保留的startup.cs文件,使用program.cs
This commit is contained in:
大灰灰
2022-11-06 05:38:42 +08:00
parent 84fbcfffbd
commit 45877f0d5c
23 changed files with 1316 additions and 819 deletions

View File

@@ -15,6 +15,7 @@ using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreCms.Net.Configuration;
using CoreCms.Net.DTO.ComponentsDTO;
using CoreCms.Net.IRepository;
using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.IServices;
@@ -910,7 +911,7 @@ namespace CoreCms.Net.Services
/// <param name="number"></param>
/// <param name="isRecommend"></param>
/// <returns></returns>
public async Task<List<CoreCmsGoods>> GetGoodsRecommendList(int number, bool isRecommend = false)
public async Task<List<GoodListDTO>> GetGoodsRecommendList(int number, bool isRecommend = false)
{
return await _dal.GetGoodsRecommendList(number, isRecommend);
}
@@ -998,6 +999,24 @@ namespace CoreCms.Net.Services
}
#endregion
#region DTO
/// <summary>
/// 重写根据条件及自定义排序查询分页数据返回DTO
/// </summary>
/// <param name="predicate"></param>
/// <param name="orderBy"></param>
/// <param name="pageIndex">当前页面索引</param>
/// <param name="pageSize">分布大小</param>
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
/// <returns></returns>
public async Task<IPageList<GoodListDTO>> QueryPageByDTOAsync(Expression<Func<GoodListDTO, bool>> predicate,
string orderBy = "", int pageIndex = 1, int pageSize = 20, bool blUseNoLock = false)
{
return await _dal.QueryPageByDTOAsync(predicate, orderBy, pageIndex, pageSize, blUseNoLock);
}
#endregion
/// <summary>
/// 根据条件查询代理池商品分页数据
/// </summary>
@@ -1058,5 +1077,46 @@ namespace CoreCms.Net.Services
return await _dal.QueryGoodWithDefaultProductAsync(predicate, orderByPredicate, orderByType, blUseNoLock);
}
/// <summary>
/// 根据条件查询一定数量数据(用于组件)
/// </summary>
/// <param name="predicate">条件表达式树</param>
/// <param name="take">获取数量</param>
/// <param name="orderByPredicate">排序字段</param>
/// <param name="orderByType">排序顺序</param>
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
/// <param name="isDataCache">是否缓存</param>
/// <param name="cacheTimes">缓存时间(分钟)</param>
/// <returns></returns>
public async Task<List<GoodListDTO>> QueryListByComponentsAsync(Expression<Func<GoodListDTO, bool>> predicate,
int take,
Expression<Func<GoodListDTO, object>> orderByPredicate, OrderByType orderByType, bool blUseNoLock = false,
bool isDataCache = false, int cacheTimes = int.MaxValue)
{
return await _dal.QueryListByComponentsAsync(predicate, take, orderByPredicate, orderByType, blUseNoLock,
isDataCache, cacheTimes);
}
/// <summary>
/// 根据条件查询一定数量数据(用于组件)
/// </summary>
/// <param name="predicate">条件表达式树</param>
/// <param name="take">获取数量</param>
/// <param name="orderByPredicate">排序字段</param>
/// <param name="orderByType">排序顺序</param>
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
/// <param name="isDataCache">是否缓存</param>
/// <param name="cacheTimes">缓存时间(分钟)</param>
/// <returns></returns>
public async Task<List<GoodListDTO>> QueryListByComponentsAsync(Expression<Func<GoodListDTO, bool>> predicate,
int take, string orderByType = "", bool blUseNoLock = false,
bool isDataCache = false, int cacheTimes = int.MaxValue)
{
return await _dal.QueryListByComponentsAsync(predicate, take, orderByType, blUseNoLock,
isDataCache, cacheTimes);
}
}
}