select from_unixtime(st.pay_time,'%Y-%m-%d') as '支付时间',count(st.tid) '买单总订单数',round(sum(st.total_fee+IFNULL(st.post_fee,0)),2) '买单总销售金额' from systrade_trade st LEFT JOIN systrade_order so on st.tid=so.tid LEFT JOIN sysshop_shop sss ON st.shop_id=sss.shop_id where so.item_id=0 and st.`status` in ('WAIT_SELLER_SEND_GOODS','WAIT_BUYER_CONFIRM_GOODS','TRADE_FINISHED','TRADE_CLOSED') and st.tid in (select tid from systrade_order where title not like '%测试%' ) and from_unixtime(st.pay_time,'%Y-%m-%d')>='2018-11-01' GROUP BY from_unixtime(st.pay_time,'%Y-%m-%d') desc
|