@@ -217,12 +217,20 @@ where go.OrderStatus in(1,2,3,4,5,6) and go.`Status`=0 {where}";
where+=$@" and o.{nameof(RB_Goods_Order.OrderStatus)} in(1,2,3,4,5,6)";
}
// string sql = $@"SELECT GROUP_CONCAT(oc.OrderDetailId) as OrderDetailIds,oc.OrderId,oc.OrderDetailId,o.OrderNo,o.UserId,oc.CommissionRatio,oc.Type,oc.CommissionState,o.OrderStatus as DistrbutionOrderSelectStatus,SUM(oc.Commission) as Commission
//FROM RB_Goods_OrderIntroduction as oc
//inner join rb_goods_order o on oc.OrderId = o.OrderId
//INNER JOIN rb_goods_orderdetail as od on od.Id=oc.OrderDetailId
//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 order by oc.OrderId desc";
stringsql=$@"SELECT GROUP_CONCAT(oc.OrderDetailId) as OrderDetailIds,oc.OrderId,oc.OrderDetailId,o.OrderNo,o.UserId,oc.CommissionRatio,oc.Type,oc.CommissionState,o.OrderStatus as DistrbutionOrderSelectStatus,SUM(oc.Commission) as Commission
FROM RB_Goods_OrderIntroduction oc
FROM rb_goods_orderdetail as od
INNER JOIN RB_Goods_OrderIntroduction as oc on od.Id=oc.OrderDetailId
inner join rb_goods_order o on oc.OrderId = o.OrderId
INNER JOIN rb_goods_orderdetail as od on od.Id=oc.OrderDetailId
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 order by oc.OrderId desc";
@@ -105,7 +105,7 @@ where {where} order by di.CreateDate desc";
}
if(!string.IsNullOrEmpty(dmodel.Name))
{
where+=$@" and di.{nameof(RB_Distributor_Info.Name)} like '%{dmodel.Name}%'";
where+=$@" and (mu.{nameof(RB_Member_User.Name)} like '%{dmodel.Name}%' or di.{nameof(RB_Distributor_Info.Name)} like '%{dmodel.Name}%' )";
}
stringsql=$@"select di.*,mu.OpenId,mu.Name as MemberUserName from RB_Distributor_Info di LEFT JOIN rb_member_user as mu on di.UserId=mu.Id where {where} order by di.CreateDate desc";