SELECT DATE_FORMAT(cc.datefield, '%d-%b') AS DATE
, SUM(IFNULL(cds.quantity,0)) AS total_sales
FROM cart_calendar cc
INNER JOIN cart_daily_sales cds
ON (DATE(cds.order_date) = cc.datefield)
WHERE WEEK(cc.datefield) = WEEK(now())
GROUP BY WEEK(cc.datefield)
Atau jika Anda menginginkannya per hari:
SELECT DATE_FORMAT(cc.datefield, '%d-%b') AS DATE
, SUM(IFNULL(cds.quantity,0)) AS total_sales
FROM cart_calendar cc
INNER JOIN cart_daily_sales cds
ON (DATE(cds.order_date) = cc.datefield)
WHERE WEEK(cc.datefield) = WEEK(now())
GROUP BY MOD(WEEKDAY(cc.datefield)+1,6) WITH ROLLUP