app/Http/Controllers/Admin/LianjieController.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()
    {   
        $l_name = request()->l_name;
        $where = [];
        if($l_name){
            $where[]=['l_name','like',"%$l_name"];
        }
        $pageSize = config('app.pageSize');
        $lianjie = Lianjie::orderBy('l_id','desc')->where($where)->paginate($pageSize);
        return view('admin.lianjie.index',['lianjie'=>$lianjie,'l_name'=>$l_name]);
    }
public function index ( ) { $ l_name = request ( ) -> l_name ; $ where = [ ] ; if ( $ l_name ) { $ where [ ] = [ 'l_name' , 'like' , " % $ l_name " ] ; } $ pageSize = config ( 'app.pageSize' ) ; $ lianjie = Lianjie :: orderBy ( 'l_id' , 'desc' ) -> where ( $ where ) -> paginate ( $ pageSize ) ; return view ( 'admin.lianjie.index' , [ 'lianjie' => $ lianjie , 'l_name' => $ l_name ] ) ; }
Display a listing of the resource.
Display a listing of the resource .
//$brand = DB::table('brand')->all(); //orm操作