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 ...@@ -241,14 +241,14 @@ where {where} group by oc.OrderId,o.OrderNo,oc.UserId,oc.Type,oc.Grade order by
/// <returns></returns> /// <returns></returns>
public List<RB_Goods_OrderCommission_Extend> GetListGroupByUserRepository(int pageIndex, int pageSize, out long count, RB_Goods_OrderCommission_Extend dmodel) 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) 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) 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) if (dmodel.OrderId > 0)
{ {
...@@ -256,7 +256,7 @@ where {where} group by oc.OrderId,o.OrderNo,oc.UserId,oc.Type,oc.Grade order by ...@@ -256,7 +256,7 @@ where {where} group by oc.OrderId,o.OrderNo,oc.UserId,oc.Type,oc.Grade order by
} }
if (dmodel.UserId > 0) 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)) 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 ...@@ -277,11 +277,21 @@ where {where} group by oc.OrderId,o.OrderNo,oc.UserId,oc.Type,oc.Grade order by
} }
string sql = $@" string sql = $@"
SELECT oc.OrderId,o.OrderNo,o.UserId,oc.Type,oc.Grade,oc.CommissionState,o.OrderStatus as DistrbutionOrderSelectStatus,SUM(oc.Commission) as Commission SELECT o.OrderId,o.OrderNo,o.UserId,o.OrderStatus AS DistrbutionOrderSelectStatus
FROM rb_goods_order o LEFT JOIN RB_Goods_OrderCommission oc on oc.OrderId = o.OrderId ,IFNULL(oc.Commission,0) AS Commission,oc.Type AS Type,oc.Grade AS Grade,oc.CommissionState AS CommissionState
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) FROM rb_goods_order o
where {where} group by oc.OrderId,o.OrderNo,oc.UserId,oc.Type,oc.Grade order by oc.OrderId desc"; LEFT JOIN (
return GetPage<RB_Goods_OrderCommission_Extend>(pageIndex, pageSize, out count, sql).ToList(); 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> /// <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