@@ -970,10 +975,15 @@ as t GROUP BY t.CreateDate desc";
}
else
{
sql=$@"SELECT t.CreateDate,SUM(t.ReNumber)as GoodsNum ,COUNT(t.ReOrderId)as OrderNum ,SUM(t.Income)as PayMoney,MAX(t.PayMemerNum) as PayMemerNum
from (SELECT DATE_FORMAT(a.CreateDate,'%Y-%m-%d' )as CreateDate,a.ReNumber,a.Refund as Income,c.PayMemerNum,a.ReOrderId from RB_Goods_OrderAfterSale as a
LEFT JOIN (SELECT COUNT(DISTINCT UserId) as PayMemerNum, DATE_FORMAT(CreateDate,'%Y-%m-%d' ) as CreateDate from RB_Goods_OrderAfterSale where {payMemerNumWhere} GROUP BY DATE_FORMAT(CreateDate,'%Y-%m-%d' ))
as c on c.CreateDate=DATE_FORMAT(a.CreateDate,'%Y-%m-%d' ) {where} )
sql=$@"
SELECT t.CreateDate,SUM(t.ReNumber)as GoodsNum ,COUNT(t.ReOrderId)as OrderNum ,SUM(t.Income)as PayMoney,MAX(t.PayMemerNum) as PayMemerNum
from
(
SELECT DATE_FORMAT(a.CreateDate,'%Y-%m-%d' )as CreateDate,a.ReNumber,a.Refund as Income,c.PayMemerNum,a.ReOrderId from RB_Goods_OrderAfterSale as a
LEFT JOIN
(SELECT COUNT(DISTINCT UserId) as PayMemerNum, DATE_FORMAT(CreateDate,'%Y-%m-%d' ) as CreateDate from RB_Goods_OrderAfterSale where 1=1 {payMemerNumWhere} GROUP BY DATE_FORMAT(CreateDate,'%Y-%m-%d' ))
as c on c.CreateDate=DATE_FORMAT(a.CreateDate,'%Y-%m-%d' ) {where}