get('key', ''); $where = [ ['is_display','=',1], ['type_id','=',66], ]; if (!empty($key)) { $where[] = ['title','like','%'.$key.'%']; } $rst = Article::where($where) ->orderBy('list_order', 'desc') ->orderBy('id', 'desc') ->paginate($size); if ($request->ajax()) { if ($rst->lastPage() < $rst->currentPage()) { return response()->json(['status' => 0]); } return response()->json(['status' => 1, 'data' => view('mobile.app.ic.gongzhonghao.ajax_gongzhonghao_list', ['articles' => $rst])->render()]); } $mobile_dropload = false; if ($rst->total() > $size) { $mobile_dropload = true; } $return_data = [ 'articles' => $rst, 'mobile_dropload' => $mobile_dropload, 'key' => $key, ]; return view('mobile.app.ic.gongzhonghao.index', $return_data); } }