diff --git a/model/SqlCriteria.php b/model/SqlCriteria.php index 65b6f58..3c0649e 100644 --- a/model/SqlCriteria.php +++ b/model/SqlCriteria.php @@ -147,7 +147,10 @@ class SqlCriteria */ public function select($fields) { - $fields = array_map(function($item){return trim($item);},explode(',', $fields)); + if (!is_array($fields)) { + $fields = explode(',', $fields); + } + $fields = array_map(function($item){return trim($item);},$fields); $this->select = array_merge($this->select,$fields); return $this; }