update plan fetch

This commit is contained in:
Tokumeikoi 2020-06-24 14:26:43 +08:00
parent f10fc4c13e
commit 015798accd

View File

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