Commit 2afba2e5 authored by 吴春's avatar 吴春

提交代码

parent f84a7e29
......@@ -4023,10 +4023,10 @@ namespace Mall.Module.User
/// <param name="demodel"></param>
/// <param name="NewUserId"></param>
/// <returns></returns>
public object GetUserMyTeamPageListForFX(int pageIndex, int pageSize, out long count, RB_Distributor_Info_Extend demodel,int NewUserId=0)
public object GetUserMyTeamPageListForFX(int pageIndex, int pageSize, out long count, RB_Distributor_Info_Extend demodel, int NewUserId = 0)
{
string UserIds = member_UserRepository.GetMemberChildIdStr(demodel.UserId ?? 0);
var list = member_UserRepository.GetPageListForFX(pageIndex, pageSize, out count,
new RB_Member_User_Extend()
{
......@@ -4036,8 +4036,8 @@ namespace Mall.Module.User
TenantId = demodel.TenantId,
MallBaseId = demodel.MallBaseId,
SortNum = demodel.SortNum,
IsDirect=demodel.IsDirect,
Id=(demodel.UserId ?? 0)
IsDirect = demodel.IsDirect,
Id = (demodel.UserId ?? 0)
});
List<object> RList = new List<object>();
if (list.Any())
......@@ -4362,6 +4362,8 @@ namespace Mall.Module.User
List<RB_Goods_Order_Extend> olist = goods_OrderRepository.GetAppletGoodsOrderNumStatistics(umodel.Id, umodel.TenantId, umodel.MallBaseId);
//待评价
int WaitCommentNum = goods_OrderRepository.GetAppletGoodsOrderWaitCommentNum(umodel.Id, umodel.TenantId, umodel.MallBaseId);
//司导订单待评价
int GuideCarWaitCommentNum = goods_OrderRepository.GetAppletGoodsOrderWaitCommentNum(umodel.Id, umodel.TenantId, umodel.MallBaseId, 1);
//售后处理中
int AfterSaleNum = goods_OrderRepository.GetAppletGoodsOrderAfterSaleNum(umodel.Id, umodel.TenantId, umodel.MallBaseId);
string parent_name = "";
......@@ -4457,12 +4459,20 @@ namespace Mall.Module.User
},
MyOrder = new
{
NonPayment = olist.Where(x => x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.NonPayment).FirstOrDefault()?.OrderNum ?? 0,
WaitSendGoods = olist.Where(x => x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.WaitSendGoods).FirstOrDefault()?.OrderNum ?? 0,
WaitReceiving = olist.Where(x => x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.WaitReceiving).FirstOrDefault()?.OrderNum ?? 0,
NonPayment = olist.Where(x => x.OrderClassify == 0 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.NonPayment).FirstOrDefault()?.OrderNum ?? 0,
WaitSendGoods = olist.Where(x => x.OrderClassify == 0 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.WaitSendGoods).FirstOrDefault()?.OrderNum ?? 0,
WaitReceiving = olist.Where(x => x.OrderClassify == 0 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.WaitReceiving).FirstOrDefault()?.OrderNum ?? 0,
WaitCommentNum,
AfterSaleNum
},
MyGuideCarOrder = new
{
NonPayment = olist.Where(x => x.OrderClassify == 1 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.NonPayment).FirstOrDefault()?.OrderNum ?? 0,
WaitSendGoods = olist.Where(x => x.OrderClassify == 1 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.WaitSendGoods).FirstOrDefault()?.OrderNum ?? 0,
WaitReceiving = olist.Where(x => x.OrderClassify == 1 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.WaitReceiving).FirstOrDefault()?.OrderNum ?? 0,
GuideCarWaitCommentNum,
Completed = olist.Where(x => x.OrderClassify == 1 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.Completed).FirstOrDefault()?.OrderNum ?? 0,
},
isShowDistributionCenter = IsShowDistributionCenter
};
}
......
......@@ -117,11 +117,12 @@ namespace Mall.Repository.Product
{
where += $@" and o.{nameof(RB_Goods_Order.Recycled)}={(int)dmodel.Recycled}";
}
if (dmodel.SmallShopsId.HasValue&& dmodel.SmallShopsId > 0)
if (dmodel.SmallShopsId.HasValue && dmodel.SmallShopsId > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.SmallShopsId)}={dmodel.SmallShopsId}";
}
if (dmodel.IsSelectPayMoney == 1) {
if (dmodel.IsSelectPayMoney == 1)
{
where += $@" and o.{nameof(RB_Goods_Order.PaymentTime)} IS NOT NULL";
}
......@@ -543,7 +544,7 @@ where {where} group by o.OrderId order by o.CreateDate desc";
{
where += $@" and oc.{nameof(RB_SmallShops_Commission.UserId)}={dmodel.DistributionUserId}";
}
if (dmodel.SmallShopsId > 0)
if (dmodel.SmallShopsId > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.SmallShopsId)}={(int)dmodel.SmallShopsId}";
}
......@@ -636,7 +637,7 @@ WHERE od.GoodsId in({goodsIds}) and o.`Status`=0 and o.OrderStatus <> 7 group by
/// <returns></returns>
public List<RB_Goods_Order_Extend> GetAppletGoodsOrderNumStatistics(int userId, int tenantId, int mallBaseId)
{
string sql = $" SELECT OrderStatus,COUNT(0) as OrderNum FROM rb_goods_order WHERE `Status`=0 and OrderStatus in (1,2,3) and UserId={userId} and TenantId={tenantId} and MallBaseId={mallBaseId} GROUP BY OrderStatus";
string sql = $" SELECT OrderStatus,COUNT(0) as OrderNum,OrderClassify FROM rb_goods_order WHERE `Status`=0 and OrderStatus in (1,2,3,5) and UserId={userId} and TenantId={tenantId} and MallBaseId={mallBaseId} GROUP BY OrderStatus,OrderClassify";
return Get<RB_Goods_Order_Extend>(sql).ToList();
}
......@@ -647,12 +648,12 @@ WHERE od.GoodsId in({goodsIds}) and o.`Status`=0 and o.OrderStatus <> 7 group by
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public int GetAppletGoodsOrderWaitCommentNum(int userId, int tenantId, int mallBaseId)
public int GetAppletGoodsOrderWaitCommentNum(int userId, int tenantId, int mallBaseId, int OrderClassify = 0)
{
string sql = $@"SELECT COUNT(0) as OrderNum FROM(
SELECT o.OrderId FROM rb_goods_order o
INNER JOIN rb_goods_orderdetail od on o.OrderId=od.OrderId
WHERE o.`Status`=0 and o.OrderStatus =4 and od.IsComment=2 and o.UserId={userId} and o.TenantId={tenantId} and o.MallBaseId={mallBaseId}
WHERE o.`Status`=0 and o.OrderStatus =4 and od.IsComment=2 and o.UserId={userId} and o.TenantId={tenantId} and o.MallBaseId={mallBaseId} and o.OrderClassify={OrderClassify}
GROUP BY o.OrderId)t";
var obj = ExecuteScalar(sql);
if (obj != null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment