@@ -1031,7 +1031,7 @@ SELECT 0 as Total,0 as MemberNum, 0 as GoodsNum,0 as OrderNum,
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.GoodsTotalNum)as GoodsTotalNum ,COUNT(t.OrderId)as OrderNum ,SUM(t.Income)as Income,SUM(case WHEN IsOffline=1 then 1 else 0 end )as OfflineOrder,
sql=$@"SELECT t.CreateDate,SUM(t.GoodsTotalNum)as GoodsTotalNum ,COUNT(t.OrderId)as OrderNum ,SUM(t.Income)as Income,SUM(case WHEN IsOffline=1 then 1 else 0 end )as OfflineOrder,SUM(case WHEN t.IsOffline=1 then t.Income else 0 end )as OfflineOrderPrice,
(SELECT COUNT(DISTINCT UserId) from rb_goods_order where 1=1 {payMemerNumWhere} ) as TotalPayMemerNum,
COUNT(DISTINCT t.UserId) 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,a.IsOffline from rb_goods_order as a
...
...
@@ -1180,7 +1180,7 @@ LEFT JOIN rb_member_user as c on b.UserId=c.Id
SELECT t.CreateDate,SUM(t.GoodsNum)as GoodsNum ,COUNT(t.OrderId)as OrderNum ,SUM(case WHEN IsOffline=1 then 1 else 0 end )as OfflineOrder,SUM(t.Income)as PayMoney,COUNT(DISTINCT t.UserId) as PayMemerNum,GROUP_CONCAT(DISTINCT t.UserId) as UserIds
SELECT t.CreateDate,SUM(t.GoodsNum)as GoodsNum ,COUNT(t.OrderId)as OrderNum ,SUM(case WHEN IsOffline=1 then 1 else 0 end )as OfflineOrder,SUM(case WHEN t.IsOffline=1 then t.Income else 0 end )as OfflineOrderPrice,SUM(t.Income)as PayMoney,COUNT(DISTINCT t.UserId) as PayMemerNum,GROUP_CONCAT(DISTINCT t.UserId) as UserIds