get('key', ''); $where = [ ['is_display','=',1], ['type_id','=',67], ]; 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.attract.ajax_attract_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.attract.index', $return_data); } public function show(Request $request) { $id = $request->get('id', 0); $info = Article::where('id', $id)->first(); return view('mobile.app.ic.attract.show', ['info' => $info]); } }