stringsql=$@"SELECT t.CreateDate as StartTime,SUM(t.FreightMoney + t.Final_Price) AS Income FROM (
SELECT o.OrderId,DATE_FORMAT(o.CreateDate,'%y-%m-%d') AS CreateDate,o.FreightMoney,SUM(od.Final_Price) AS Final_Price FROM rb_goods_order o
LEFT JOIN rb_goods_orderdetail od on o.OrderId = od.OrderId
LEFT JOIN rb_goods_orderaftersale oa on od.Id = oa.OrderDetialId and oa.Type=1 and oa.ReOrderStatus =5
WHERE o.MallBaseId ={mallBaseId} and o.OrderStatus in(2,3,4,5,6) and o.Recycled=2 and o.`Status`=0 and o.UserId ={userId} and o.CreateDate >= '{startTime}' AND o.CreateDate <= '{endTime} 23:59:59' AND oa.ReOrderId is NULL
stringsql=$@"SELECT t.CreateDate as StartTime,SUM(t.FreightMoney + t.Final_Price) AS Income FROM (
SELECT o.OrderId,DATE_FORMAT(o.CreateDate,'%y-%m-%d') AS CreateDate,o.FreightMoney,SUM(od.Final_Price) AS Final_Price FROM rb_goods_order o
INNER JOIN rb_goods_orderdetail od on o.OrderId = od.OrderId
INNER JOIN rb_goods_ordercommission oc on od.Id = oc.OrderDetailId
LEFT JOIN rb_goods_orderaftersale oa on od.Id = oa.OrderDetialId and oa.Type=1 and oa.ReOrderStatus =5
WHERE o.MallBaseId ={mallBaseId} and o.OrderStatus in(2,3,4,5,6) and o.Recycled=2 and o.`Status`=0 and oc.UserId = {userId} and o.UserId <> {userId} and o.CreateDate >= '{startTime}' AND o.CreateDate <= '{endTime} 23:59:59' AND oa.ReOrderId is NULL
stringsql=$@"SELECT SUM(t.FreightMoney + t.Final_Price) AS Income FROM (
SELECT o.OrderId,o.FreightMoney,SUM(od.Final_Price) AS Final_Price FROM rb_goods_order o
INNER JOIN rb_goods_orderdetail od on o.OrderId = od.OrderId
INNER JOIN rb_goods_ordercommission oc on od.Id = oc.OrderDetailId
LEFT JOIN rb_goods_orderaftersale oa on od.Id = oa.OrderDetialId and oa.Type=1 and oa.ReOrderStatus =5
WHERE o.MallBaseId ={mallBaseId} and o.OrderStatus in(2,3,4,5,6) and o.Recycled=2 and o.`Status`=0 and oc.UserId = {userId} and o.UserId <> {userId} AND oa.ReOrderId is NULL
INNER JOIN rb_vipbuy_commission vc on v.Id = vc.OrderId
WHERE v.MallBaseId ={mallBaseId} and v.`Status` =0 and v.PayState =1 and vc.UserId ={userId} and v.CreateDate >= '{startTime}' AND v.CreateDate <= '{endTime} 23:59:59'
stringsql=$@"SELECT SUM(vc.Commission) FROM rb_vip_buy v
INNER JOIN rb_vipbuy_commission vc on v.Id = vc.OrderId
WHERE v.MallBaseId ={mallBaseId} and v.`Status` =0 and v.PayState =1 and vc.UserId ={userId} and v.CreateDate >= '{startTime}' AND v.CreateDate <= '{endTime} 23:59:59'";
stringsql=$@"SELECT t.CreateDate as CreateTimeStr,SUM(t.Money) AS Money FROM (
SELECT v.Id,DATE_FORMAT(v.CreateDate,'%Y-%d-%m') AS CreateDate,v.Money FROM rb_vip_buy v
INNER JOIN rb_vipbuy_commission vc on v.Id = vc.OrderId
WHERE v.`Status`=0 and v.MallBaseId ={mallBaseId} and v.PayState =1 and vc.UserId ={userId} and v.CreateDate >= '{startTime}' AND v.CreateDate <= '{endTime} 23:59:59'