app/Http/Controllers/Index/ClientController.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()
    {
        $pageSize = config('app.pageSize');
        $client_name = request()->client_name;
        $where = [];
        if($client_name){
            $where[] = ['client_name','like',"%$client_name%"];
        }
        $client_ma = request()->client_ma;
        if($client_ma){
            $where[] = ['client_ma','=',"$client_ma"];
        }
        $client_jian = request()->client_jian;
        if($client_jian){
            $where[] = ['client_jian','=',"$client_jian"];
        }
        $country = request()->country;
        if($country){
            $where[] = ['country','=',"$country"];
        }
        $com = request()->com;
        if($com){
            $where[] = ['com','=',$com];
        }
        $liebie = request()->liebie;
        if($liebie){
            $where[] = ['liebie','=',$liebie];
        }
        $fangshi = request()->fangshi;
        if($fangshi){
            $where[] = ['fangshi','=',$fangshi];
        }
        $shuxing = request()->shuxing;
        if($shuxing){
            $where[] = ['shuxing','=',$shuxing];
        }
        $xingzhi = request()->xingzhi;
        if($xingzhi){
            $where[] = ['xingzhi','=',$xingzhi];
        }
        $data = Client::where($where)->join('users','client.id','=','users.id')->paginate($pageSize);
        $query = request()->all();
        return view('index.client.index',['data'=>$data,'query'=>$query]);
    }
public function index ( ) { $ pageSize = config ( 'app.pageSize' ) ; $ client_name = request ( ) -> client_name ; $ where = [ ] ; if ( $ client_name ) { $ where [ ] = [ 'client_name' , 'like' , " % $ client_name % " ] ; } $ client_ma = request ( ) -> client_ma ; if ( $ client_ma ) { $ where [ ] = [ 'client_ma' , '=' , " $ client_ma " ] ; } $ client_jian = request ( ) -> client_jian ; if ( $ client_jian ) { $ where [ ] = [ 'client_jian' , '=' , " $ client_jian " ] ; } $ country = request ( ) -> country ; if ( $ country ) { $ where [ ] = [ 'country' , '=' , " $ country " ] ; } $ com = request ( ) -> com ; if ( $ com ) { $ where [ ] = [ 'com' , '=' , $ com ] ; } $ liebie = request ( ) -> liebie ; if ( $ liebie ) { $ where [ ] = [ 'liebie' , '=' , $ liebie ] ; } $ fangshi = request ( ) -> fangshi ; if ( $ fangshi ) { $ where [ ] = [ 'fangshi' , '=' , $ fangshi ] ; } $ shuxing = request ( ) -> shuxing ; if ( $ shuxing ) { $ where [ ] = [ 'shuxing' , '=' , $ shuxing ] ; } $ xingzhi = request ( ) -> xingzhi ; if ( $ xingzhi ) { $ where [ ] = [ 'xingzhi' , '=' , $ xingzhi ] ; } $ data = Client :: where ( $ where ) -> join ( 'users' , 'client.id' , '=' , 'users.id' ) -> paginate ( $ pageSize ) ; $ query = request ( ) -> all ( ) ; return view ( 'index.client.index' , [ 'data' => $ data , 'query' => $ query ] ) ; }
Display a listing of the resource.
Display a listing of the resource .