0
我想從我的控制器上運行laravel的聯接查詢,但我得到了「調用成員函數leftJoin()null」將查詢結果加入到「調用成員函數leftJoin()null」
public function tracking_groupindividual(Request $request)
{
$user_id = $request->user_id;
$group_id = $request->group_id;
$get_group_individual_details = DB::table('group_usermapping as gu')
->select(
'um.user_id',
'um.user_name',
'um.image_path',
'um.mobile_number',
'ul.latitude',
'ul.longitude',
'um.isnearby_on',
'gu.isadmin',
'um.profile_status',
'ul.timedout'
)
->join('user_master as um','gu.user_id','=','um.user_id')
->join('groupusers_location as ul','ul.user_id','=','um.user_id','ul.group_id','=','gu.group_id')
->where(function ($query) use ($group_id) {
$query->where('gu.group_id', '=', $group_id)
->where('gu.isactive','=','1')->where('um.isactive','=','1');
})->get();
return $get_group_individual_details;
}
現在在選擇「調用成員函數select()null」時出現相同的錯誤「@Morteza Rajabi – Akumar
使用Use Illuminate \ Support \ Facades \ DB在我的控制器中導入數據庫類 – Akumar