diff --git a/model/SqlCriteria.php b/model/SqlCriteria.php index 9f18fd4..58b26dc 100644 --- a/model/SqlCriteria.php +++ b/model/SqlCriteria.php @@ -106,12 +106,16 @@ class SqlCriteria } /** - * @param string $field + * @param string|array $fields + * @ex SqlCriteria::select('field') + * @ex SqlCriteria->select(array('field1', 'field2')) + * @ex SqlCriteria->select('field1,field2') * @return SqlCriteria */ - public function select($field) + public function select($fields) { - $this->select[] = $field; + $fields = explode(',', $fields); + $this->select = $this->select + $fields; return $this; }