|
@@ 2011-2015 (lines=5) @@
|
| 2008 |
|
if (!isset($params[1])) { |
| 2009 |
|
$params[1] = 'count'; |
| 2010 |
|
} |
| 2011 |
|
if (is_object($model) && $model->isVirtualField($params[0])) { |
| 2012 |
|
$arg = $this->_quoteFields($model->getVirtualField($params[0])); |
| 2013 |
|
} else { |
| 2014 |
|
$arg = $this->name($params[0]); |
| 2015 |
|
} |
| 2016 |
|
return 'COUNT(' . $arg . ') AS ' . $this->name($params[1]); |
| 2017 |
|
case 'max': |
| 2018 |
|
case 'min': |
|
@@ 2022-2026 (lines=5) @@
|
| 2019 |
|
if (!isset($params[1])) { |
| 2020 |
|
$params[1] = $params[0]; |
| 2021 |
|
} |
| 2022 |
|
if (is_object($model) && $model->isVirtualField($params[0])) { |
| 2023 |
|
$arg = $this->_quoteFields($model->getVirtualField($params[0])); |
| 2024 |
|
} else { |
| 2025 |
|
$arg = $this->name($params[0]); |
| 2026 |
|
} |
| 2027 |
|
return strtoupper($func) . '(' . $arg . ') AS ' . $this->name($params[1]); |
| 2028 |
|
} |
| 2029 |
|
} |