【优化】优化分销商升级策略。

This commit is contained in:
jianweie code
2023-06-17 03:16:51 +08:00
parent fb086a16a0
commit 9151fbf43f
6 changed files with 158 additions and 35 deletions

View File

@@ -167,6 +167,27 @@ namespace CoreCms.Net.Repository
}
#endregion
#region id和商品id获取下了多少订单
/// <summary>
/// 根据用户id和商品id获取下了多少订单
/// </summary>
/// <param name="userId"></param>
/// <param name="goodId"></param>
/// <param name="orderStatus">状态</param>
/// <returns></returns>
public int GetOrderNum(int userId, int goodId,int orderStatus)
{
var num = DbClient.Queryable<CoreCmsOrder, CoreCmsOrderItem>((op, ot) => new object[]
{
JoinType.Inner, op.orderId == ot.orderId
}).Where((op, ot) => op.userId == userId && ot.goodsId == goodId && op.status == orderStatus).Count();
return num;
}
#endregion
#region
/// <summary>
/// 重写根据条件列表数据