CI_DB_active_record::where_in PHP Method

where_in() public method

Generates a WHERE field IN ('item', 'item') SQL query joined with AND if appropriate
public where_in ( $key = NULL, $values = NULL ) : object
return object
    function where_in($key = NULL, $values = NULL)
    {
        return $this->_where_in($key, $values);
    }

Usage Example

Beispiel #1
0
 /**
  * 重写where
  * @param mixed $where
  * return CU_Model $this->db
  */
 protected function where()
 {
     $args = func_get_args();
     if (is_array($args[0])) {
         foreach ($args[0] as $k => $wh) {
             if (is_array($wh)) {
                 $this->db->where_in($k, $wh);
             } else {
                 $this->db->where($k, $wh);
             }
         }
     } else {
         if (empty($args[0])) {
             return $this->db;
         }
         call_user_func_array(array($this->db, 'where'), $args);
     }
     return $this->db;
 }