【修复】修复商品下架后,购物车未清理缓存,导致商品还存在购物车可以下单跳转的情况。

【修复】修复商品下架或者删除后,我的足迹统计数据不准确的问题。
This commit is contained in:
大灰灰
2022-12-07 01:38:10 +08:00
parent b6db382dc0
commit 422ece5c65
5 changed files with 45 additions and 1 deletions

View File

@@ -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,