@@ -827,7 +827,7 @@ SELECT 0 as Total,0 as MemberNum, 0 as GoodsNum,0 as OrderNum,
where+=$" AND DATE_FORMAT(a.{nameof(RB_Goods_Order.CreateDate)},'%Y-%m-%d' )<= DATE_FORMAT('{dmodel.EndDate}','%Y-%m-%d' )";
payMemerNumWhere+=$" AND DATE_FORMAT({nameof(RB_Goods_OrderAfterSale.CreateDate)},'%Y-%m-%d' )<= DATE_FORMAT('{dmodel.EndDate}','%Y-%m-%d' )";
}
sql=$@"SELECT t.CreateDate,SUM(t.GoodsNum)as GoodsTotalNum ,COUNT(t.OrderId)as OrderNum ,SUM(t.Income)as PayMoney,MAX(t.PayMemerNum) as PayMemerNum,GROUP_CONCAT(DISTINCT t.UserId) as UserIds
sql=$@"SELECT t.CreateDate,SUM(t.GoodsTotalNum)as GoodsTotalNum ,COUNT(t.OrderId)as OrderNum ,SUM(t.Income)as PayMoney,MAX(t.PayMemerNum) as PayMemerNum,GROUP_CONCAT(DISTINCT t.UserId) as UserIds
from (SELECT DATE_FORMAT(a.CreateDate,'%Y-%m-%d' )as CreateDate,b.GoodsTotalNum,a.UserId,a.Income,a.OrderId,c.PayMemerNum from rb_goods_order as a
LEFT JOIN (SELECT OrderId,SUM(Number)as GoodsTotalNum from rb_goods_orderdetail where 1=1 {orderTypeWhere} GROUP BY OrderId)as b on a.OrderId=b.OrderId
LEFT JOIN (SELECT COUNT(DISTINCT UserId) as PayMemerNum, DATE_FORMAT(CreateDate,'%Y-%m-%d' ) as CreateDate from rb_goods_order where 1=1 {payMemerNumWhere} GROUP BY DATE_FORMAT(CreateDate,'%Y-%m-%d' ))