<?php
//控制器代码
public function vod_search(Request $request){
$where = [];
if ($request->filled('name')) {
$where[] = ['name','like','%'.$request['name'].'%'];
}
if ($request->filled('pid')) {
$where[] = ['pid','=',$request['pid']];
}
if ($request->filled('release_time')) {
$where[] = ['release_time','=',$request['release_time']];
}
$list=DB::table('art')
->where($where)
->OrderBy('id','desc')
->paginate(15);
return view('admin.art.art_list',['list'=>$list]);
}
Laravel5.8 DB多条件搜索分页例子
最新推荐文章于 2022-11-20 19:23:38 发布