root 5 years ago
parent
commit
bcdcb2e6a6
1 changed files with 4 additions and 4 deletions
  1. 4 4
      app/Console/Commands/SystemCache.php

+ 4 - 4
app/Console/Commands/SystemCache.php

@@ -48,8 +48,8 @@ class SystemCache extends Command
     private function setMonthIncome() {
         Redis::set(
             'month_income',
-            Order::where('created_at', '>', strtotime(date('Y-m-1')))
-                ->where('created_at', '>', time())
+            Order::where('created_at', '>=', strtotime(date('Y-m-1')))
+                ->where('created_at', '<', time())
                 ->where('status', '3')
                 ->where('callback_no', '!=', NULL)
                 ->sum('total_amount')
@@ -59,8 +59,8 @@ class SystemCache extends Command
     private function setMonthRegisterTotal() {
         Redis::set(
             'month_register_total',
-            User::where('created_at', '>', strtotime(date('Y-m-1')))
-                ->where('created_at', '>', time())
+            User::where('created_at', '>=', strtotime(date('Y-m-1')))
+                ->where('created_at', '<', time())
                 ->count()
         );
     }