app/Http/Controllers/admin/EntrepotController.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)
    {
         $req = $request -> input('search','');
            $data = DB::table('jc_entrepots as e')
                ->join('jc_goods as g','e.gid','=','g.id')
                ->where('g.name','like','%'.$req.'%')
                ->select('e.id','g.name','e.num','e.flag')
                ->paginate(8)->appends($request->input());
        return view('admin.entrepots.index',['title'=>'库存列表','data'=>$data,'req'=>$req]);
    }
public function index ( Request $ request ) { $ req = $ request -> input ( 'search' , '' ) ; $ data = DB :: table ( 'jc_entrepots as e' ) -> join ( 'jc_goods as g' , 'e.gid' , '=' , 'g.id' ) -> where ( 'g.name' , 'like' , '%' . $ req . '%' ) -> select ( 'e.id' , 'g.name' , 'e.num' , 'e.flag' ) -> paginate ( 8 ) -> appends ( $ request -> input ( ) ) ; return view ( 'admin.entrepots.index' , [ 'title' => '库存列表','data'= > $data, 'r e q'=> $ req]) ; }
Display a listing of the resource.
Display a listing of the resource .
// dump($data); //获取库存所有数据 // $data = Entrepots::all();