Commit da7e9a63 authored by liudong1993's avatar liudong1993

分销订单 佣金合并

parent 6ea00c15
......@@ -4228,7 +4228,7 @@ namespace Mall.Module.Product
}
var arealist = destinationRepository.GetDictvalueListForIds(areaIds);
//分销情况
; var oclist = goods_OrderCommissionRepository.GetList(new RB_Goods_OrderCommission_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, OrderIds = string.Join(",", list.Select(x => x.OrderId)) });
var oclist = goods_OrderCommissionRepository.GetListGroupByUser(new RB_Goods_OrderCommission_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, OrderIds = string.Join(",", list.Select(x => x.OrderId)) });
if (oclist.Any())
{
//获取用户
......
......@@ -79,7 +79,7 @@ where {where} order by oc.Id asc";
where += $@" and oc.{nameof(RB_Goods_OrderCommission.OrderId)} in({dmodel.OrderIds})";
}
string sql = $@"SELECT oc.OrderId,oc.UserId,oc.Grade,oc.Type,SUM(oc.Commission) as Commission FROM RB_Goods_OrderCommission oc
string sql = $@"SELECT oc.OrderId,oc.UserId,oc.Grade,oc.Type,oc.CommissionState,SUM(oc.Commission) as Commission FROM RB_Goods_OrderCommission oc
left join rb_goods_orderaftersale oa on oc.OrderDetailId= oa.OrderDetialId and oa.Type=1 and oa.Status=0 and oa.ReOrderStatus in (2,3,4,5)
where {where} group by oc.OrderId,oc.UserId,oc.Grade,oc.Type order by oc.Grade asc";
return Get<RB_Goods_OrderCommission_Extend>(sql).ToList();
......
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