手机端切换判断

4 篇文章 0 订阅

这个是对应控制器代码:

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'));

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值