Laravel复合查询

 
     if(isset($keywords['s1'])){
        $getDB=DB::table('domain')->where('DomainName','like','%'.$keywords['s1']);
     }
     
    
     if(isset($keywords['s2'])){
         
          $getDB=DB::table('domain')->where('serve',$keywords['s2']);
     }
     
   
        if(isset($keywords['s3'])){
         
          $getDB=DB::table('domain')->where('serve',$keywords['s3']);
     }
     
 
      if(isset($keywords['s4'])){
          
       $getDB=DB::table('domain')->where('RegistrantType','like','%'.$keywords['s4'].'%');
          
      }
      
  
        if(isset($keywords['s5'])){
            
            $getDB=DB::table('domain')->where('RegistrantOrganization','like','%'.$keywords['s5'].'%');
            
        }
        
       
         if(isset($keywords['s6'])){
             
            //  dd($keywords['s6']);
             for($index=0;$index<count($keywords['s6']);$index++){
                 
              
               
                 $getDB=DB::table('domain')->where('DomainName','like','%'.$keywords['s6'][$index].'%');
                 
                 
                 
                 
                 
             }
             
         }
        
        // $getDB = DB::table('domain')->where('status',1);
      
        //查询结果集
          $res = $getDB->where('status',1)->paginate(90);
      
 
      
       return $res;

  

上一篇:java 查找list中指定字符串出现的次数


下一篇:PHP中使用CURL请求页面,使用fiddler进行抓包