app/Http/Controllers/admin/OrdersController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index(Request $request)
    {
        $search = $request -> input('search',''); 
        $data = Orders::where('id','like','%'.$search.'%')->paginate(8)->appends($request->input());
        $count = DB::table('jc_orders')->whereNull('deleted_at')->count();
        return view('admin/orders/index',['data'=>$data,'title'=>'订单列表','count'=>$count]);
    }
public function index ( Request $ request ) { $ search = $ request -> input ( 'search' , '' ) ; $ data = Orders :: where ( 'id' , 'like' , '%' . $ search . '%' ) -> paginate ( 8 ) -> appends ( $ request -> input ( ) ) ; $ count = DB :: table ( 'jc_orders' ) -> whereNull ( 'deleted_at' ) -> count ( ) ; return view ( 'admin/orders/index' , [ 'data' => $ data , 'title' => '订单列表','count' = >$count ]) ; }
Display a listing of the resource.
Display a listing of the resource .
//获取请求的参数,也就是说需要搜索额参数 //获取订单表中的信息查询 // dd($data); //查询订单表中的数据总数量 //加载显示订单列表