Commit 5601d806 authored by 黄奎's avatar 黄奎

页面修改

parent 6fad7cd2
......@@ -241,14 +241,14 @@ where {where} group by oc.OrderId,o.OrderNo,oc.UserId,oc.Type,oc.Grade order by
/// <returns></returns>
public List<RB_Goods_OrderCommission_Extend> GetListGroupByUserRepository(int pageIndex, int pageSize, out long count, RB_Goods_OrderCommission_Extend dmodel)
{
string where = $" 1=1 and o.Recycled=2 and oa.ReOrderId is null";
string where = $" 1=1 and o.Recycled=2 ";
if (dmodel.TenantId > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderCommission.TenantId)}={dmodel.TenantId}";
where += $@" and o.{nameof(RB_Goods_OrderCommission.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderCommission.MallBaseId)}={dmodel.MallBaseId}";
where += $@" and o.{nameof(RB_Goods_OrderCommission.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.OrderId > 0)
{
......@@ -256,7 +256,7 @@ where {where} group by oc.OrderId,o.OrderNo,oc.UserId,oc.Type,oc.Grade order by
}
if (dmodel.UserId > 0)
{
where += string.Format(@" and (oc.UserId={0} OR o.UserId={0}) ", dmodel.UserId);
where += string.Format(@" and o.UserId={0} ", dmodel.UserId);
}
if (!string.IsNullOrEmpty(dmodel.OrderIds))
{
......@@ -277,11 +277,21 @@ where {where} group by oc.OrderId,o.OrderNo,oc.UserId,oc.Type,oc.Grade order by
}
string sql = $@"
SELECT oc.OrderId,o.OrderNo,o.UserId,oc.Type,oc.Grade,oc.CommissionState,o.OrderStatus as DistrbutionOrderSelectStatus,SUM(oc.Commission) as Commission
FROM rb_goods_order o LEFT JOIN RB_Goods_OrderCommission oc on oc.OrderId = o.OrderId
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,o.OrderNo,oc.UserId,oc.Type,oc.Grade order by oc.OrderId desc";
return GetPage<RB_Goods_OrderCommission_Extend>(pageIndex, pageSize, out count, sql).ToList();
SELECT o.OrderId,o.OrderNo,o.UserId,o.OrderStatus AS DistrbutionOrderSelectStatus
,IFNULL(oc.Commission,0) AS Commission,oc.Type AS Type,oc.Grade AS Grade,oc.CommissionState AS CommissionState
FROM rb_goods_order o
LEFT JOIN (
SELECT goc.OrderId,goc.UserId,goc.Type,goc.Grade,goc.CommissionState,SUM(goc.Commission) as Commission
FROM RB_Goods_OrderCommission as goc
LEFT JOIN rb_goods_orderaftersale oa on goc.OrderDetailId= oa.OrderDetialId and oa.Type=1 and oa.Status=0 and oa.ReOrderStatus in (2,3,4,5)
GROUP BY goc.OrderId,goc.UserId,goc.Type,goc.Grade,goc.CommissionState
)
AS oc ON oc.OrderId = o.OrderId AND o.UserId=oc.UserId
WHERE {where}
order by o.OrderId desc
";
var list= GetPage<RB_Goods_OrderCommission_Extend>(pageIndex, pageSize, out count, sql).ToList();
return list;
}
/// <summary>
......
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