}
if (!empty($q['query']['comptype'])) {
- DB_DataObject::debugLevel(1);
+
$this->whereAddIn('comptype', explode(',', $q['query']['comptype']), 'string');
}
- if (!empty($q['query']['distinct_province'])) {
- $this->selectAdd();
- $this->selectAdd('distinct(province)');
-
- }
+
}
function toEventString() {
return $this->name;
return $au->hasPerm("Core.".$this->tableName(), $lvl);
}
- function whereAddIn($key, $list, $type= 'int')
- {
- $ar = array();
- foreach($list as $k) {
- $ar[] = $type =='int' ? (int)$k : $this->escape($k);
- }
- if (!$ar) {
- return;
- }
- return $this->whereAdd("$key IN (". implode(',', $ar). ')');
- }
- function fetchAll($k= false, $v = false)
- {
- if ($k !== false) {
- $this->selectAdd();
- $this->selectAdd($k);
- if ($v !== false) {
- $this->selectAdd($v);
- }
- }
-
- $this->find();
- $ret = array();
- while ($this->fetch()) {
- if ($v !== false) {
- $ret[$this->$k] = $this->$v;
- continue;
- }
- $ret[] = $k === false ? clone($this) : $this->$k;
- }
- return $ret;
-
- }
+
}