public function upgrade()
{
$captain = DB::table('users')->where('referral_id',Auth::user()->referred_by)->get();
$captain2gen = DB::table('users')->where('referral_id',$captain-
>referred_by)->first();
return view('upgrade', ['captain' => $captain, 'captain2gen' =>
$captain2gen]);
}
这是我正在做的项目的控制器。我没有显示我的观点因为我知道问题来自$ captain2gen代码行。任何人都知道如何更好地重写这段代码?提前谢谢!