我有类似的搜索路线
public function index(Request $request)
{
if( Request::get('select_menu') !='' ){
$conditions = array();
$conditions['city'] = Request::get('city');
$conditions['area'] = Request::get('area');
$conditions['purpose'] = Request::get('status');
$results = Property::where($conditions)->whereBetween('price', array(1000, 10000))->paginate(6);
Session::set('formDataSession', $conditions);
}
elseif(Session::has('formDataSession')){
$getSession = Session::get('formDataSession');
$conditions = array();
$conditions['city'] = $getSession['city'];
$conditions['area'] = $getSession['area'];
$conditions['purpose'] = $getSession['purpose'];
$results = Property::where($conditions)->whereBetween('price', array(1000, 10000))->paginate(6);
}
return view('search', array('page' => 'search','results'=>$results));
}
现在我正在搜索主页表格中的结果等6个表单字段然后它会在搜索页面上重定向我的结果但是当我第二次在分页页面上点击它时它对我来说不起作用。我&#39 ;我在其中使用会话记住我为家庭发布的数据。我也可以在这个页面上搜索,如果我有会话,那么我在我的情况下读了第二个条件。
控制器位于
之下dplyr