SELECT dayTb.cday '日期' ,IFNULL(tNumTb.num,0) '订单数' FROM ( SELECT @cdate := DATE_ADD(@cdate, INTERVAL +1 DAY) cday FROM( SELECT @cdate := DATE_ADD('2021-03-01', INTERVAL -1 DAY) FROM order_order ) t0 WHERE date(@cdate) <= DATE_ADD('2021-03-31', INTERVAL -1 DAY) ) as dayTb
LEFT JOIN( SELECT DATE(oo.end_at) cday,count(DISTINCT oo.id) num FROM order_order oo left join member_user as mu on oo.user_id = mu.id WHERE oo.end_at >='2021-03-01' and mu.parent_service=2 GROUP BY cday ) tNumTb ON tNumTb.cday = dayTb.cday