这个是对应控制器代码:
public function index(Request $request)
{
$agent = $_SERVER['HTTP_USER_AGENT'];
if(strpos($agent,"NetFront") || strpos($agent,"iOS") || strpos($agent,"iPhone") || strpos($agent,"iPad")|| strpos($agent,"iPod")|| strpos($agent,"MIDP-2.0") || strpos($agent,"Opera Mini") || strpos($agent,"UCWEB") || strpos($agent,"Android") || strpos($agent,"Windows CE") || strpos($agent,"SymbianOS")){
return redirect('/wap');
}
// if(request()->art){
// $anhui = $this->map->where(["parentid" => request()->art])->orderBy("orderid","asc")->get();//24
// dd($anhui);
// }else{
// $art = 25;
// $anhui = $this->map->where(["parentid" => $art])->orderBy("orderid","asc")->get();//25
// dd($anhui);
// }
$banner = $this->admanage->where(["classid" => 1,"checkinfo" =>true])->orderBy("orderid",'asc')->get();
$map = $this->map->where("checkinfo",true)->where("id","!=",2)->orderBy("orderid","asc")->get();
// dd($map->toArray());
$school = $this->infoclass->where(["parentid" => 4,"checkinfo"=> true])->orderBy("orderid","asc")->take(2)->get();
$anhui = $this->map->where(["parentid" => 24])->orderBy("orderid","asc")->get();
$shanxi = $this->map->where(["parentid" => 25])->orderBy("orderid","asc")->get();
$jiangsu = $this->map->where(["parentid" => 26])->orderBy("orderid","asc")->get();
$teacher = $this->teacher->where("checkinfo",1)->orderBy("orderid","asc")->get();
return view('home.index',compact('banner','school','anhui','shanxi','jiangsu','map','teacher'));
}