Skip to content

Commit 89101e7

Browse files
Refactor transaction status filter in dashboard
charts
1 parent 50c3dc7 commit 89101e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

functions/views/dashboard-chart.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function daily_chart(){
55
global $db;
66
$sql = "SELECT DATE(created_at) AS date, SUM(total) AS total_sales
77
FROM transactions
8-
WHERE status >= 1
8+
WHERE status > 0 AND status < 4
99
GROUP BY DATE(created_at)
1010
ORDER BY DATE(created_at)";
1111

@@ -43,7 +43,7 @@ function month_chart(){
4343
global $db;
4444
$sql = "SELECT YEAR(created_at) AS year, MONTH(created_at) AS month, SUM(total) AS total_sales
4545
FROM transactions
46-
WHERE status >= 1
46+
WHERE status > 0 AND status < 4
4747
GROUP BY YEAR(created_at), MONTH(created_at)
4848
ORDER BY YEAR(created_at), MONTH(created_at)";
4949

0 commit comments

Comments
 (0)