Browse Source

update plan fetch

Tokumeikoi 4 years ago
parent
commit
015798accd
1 changed files with 4 additions and 0 deletions
  1. 4 0
      app/Http/Controllers/Admin/PlanController.php

+ 4 - 0
app/Http/Controllers/Admin/PlanController.php

@@ -22,6 +22,10 @@ class PlanController extends Controller
             DB::raw("count(*) as count")
         )
             ->where('plan_id', '!=', NULL)
+            ->where(function ($query) {
+                $query->where('expired_at', '>=', time())
+                    ->orWhere('expired_at', NULL);
+            })
             ->groupBy("plan_id")
             ->get();
         $plans = Plan::orderBy('sort', 'ASC')->get();