在我的情況,我想顯示的用戶和訂單由每個用戶完成訂單有狀態 我從輸入表格 得到$狀態這裏是我的代碼未定義的變量左加入
$orders = DB::table('user_profiles')
->leftJoin('orders', function($join){
$join->on('user_profiles.id','=','orders.id_user')
->where('orders.status','=',$status);
})
->selectRaw('user_profiles.*, count(orders.id_user) as order_try_count')
->groupBy('user_profiles.id')
->orderBy('order_try_count',$order)
->paginate(15);
但我?得到了一個未定義變量狀態,我應該怎麼做才能解決這個問題,謝謝
非常好,謝謝:) – Zezen