mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 17:23:26 +08:00
【修复】修复商品下架后,购物车未清理缓存,导致商品还存在购物车可以下单跳转的情况。
【修复】修复商品下架或者删除后,我的足迹统计数据不准确的问题。
This commit is contained in:
@@ -22,6 +22,15 @@ namespace CoreCms.Net.IRepository
|
||||
/// </summary>
|
||||
public interface ICoreCmsGoodsBrowsingRepository : IBaseRepository<CoreCmsGoodsBrowsing>
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 根据用户序列获取用户的足迹数量
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
Task<int> GetUserCountAsync(int userId);
|
||||
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
|
||||
@@ -22,6 +22,15 @@ namespace CoreCms.Net.IServices
|
||||
/// </summary>
|
||||
public interface ICoreCmsGoodsBrowsingServices : IBaseServices<CoreCmsGoodsBrowsing>
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据用户序列获取用户的足迹数量
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
Task<int> GetUserCountAsync(int userId);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
|
||||
@@ -28,6 +28,21 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据用户序列获取用户的足迹数量
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public async Task<int> GetUserCountAsync(int userId)
|
||||
{
|
||||
var count = await DbClient.Queryable<CoreCmsGoodsBrowsing, CoreCmsGoods>((gb, goods) =>
|
||||
new JoinQueryInfos(JoinType.Left, gb.goodsId == goods.id))
|
||||
.Where((gb, goods) => goods.isDel == false && goods.isMarketable == true && gb.userId == userId).With(SqlWith.NoLock).CountAsync();
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
@@ -46,6 +61,7 @@ namespace CoreCms.Net.Repository
|
||||
RefAsync<int> totalCount = 0;
|
||||
var page = await DbClient.Queryable<CoreCmsGoodsBrowsing, CoreCmsGoods>((gb, goods) =>
|
||||
new JoinQueryInfos(JoinType.Left, gb.goodsId == goods.id))
|
||||
.Where((gb, goods) => goods.isDel == false && goods.isMarketable == true)
|
||||
.Select((gb, goods) => new CoreCmsGoodsBrowsing
|
||||
{
|
||||
id = gb.id,
|
||||
|
||||
@@ -36,6 +36,16 @@ namespace CoreCms.Net.Services
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据用户序列获取用户的足迹数量
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<int> GetUserCountAsync(int userId)
|
||||
{
|
||||
return await _dal.GetUserCountAsync(userId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
|
||||
@@ -839,7 +839,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
//订单数量
|
||||
var orderCount = await _orderServices.OrderCount(0, user.id);
|
||||
//足迹
|
||||
var footPrintCount = await _goodsBrowsingServices.GetCountAsync(p => p.userId == user.id);
|
||||
var footPrintCount = await _goodsBrowsingServices.GetUserCountAsync(user.id);
|
||||
//收藏
|
||||
var collectionCount = await _goodsCollectionServices.GetCountAsync(p => p.userId == user.id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user