|
@@ 1197-1202 (lines=6) @@
|
| 1194 |
|
*/ |
| 1195 |
|
protected function makeGroupByWithHaving( $options ) { |
| 1196 |
|
$sql = ''; |
| 1197 |
|
if ( isset( $options['GROUP BY'] ) ) { |
| 1198 |
|
$gb = is_array( $options['GROUP BY'] ) |
| 1199 |
|
? implode( ',', $options['GROUP BY'] ) |
| 1200 |
|
: $options['GROUP BY']; |
| 1201 |
|
$sql .= ' GROUP BY ' . $gb; |
| 1202 |
|
} |
| 1203 |
|
if ( isset( $options['HAVING'] ) ) { |
| 1204 |
|
$having = is_array( $options['HAVING'] ) |
| 1205 |
|
? $this->makeList( $options['HAVING'], self::LIST_AND ) |
|
@@ 1203-1208 (lines=6) @@
|
| 1200 |
|
: $options['GROUP BY']; |
| 1201 |
|
$sql .= ' GROUP BY ' . $gb; |
| 1202 |
|
} |
| 1203 |
|
if ( isset( $options['HAVING'] ) ) { |
| 1204 |
|
$having = is_array( $options['HAVING'] ) |
| 1205 |
|
? $this->makeList( $options['HAVING'], self::LIST_AND ) |
| 1206 |
|
: $options['HAVING']; |
| 1207 |
|
$sql .= ' HAVING ' . $having; |
| 1208 |
|
} |
| 1209 |
|
|
| 1210 |
|
return $sql; |
| 1211 |
|
} |
|
@@ 1222-1228 (lines=7) @@
|
| 1219 |
|
* @since 1.21 |
| 1220 |
|
*/ |
| 1221 |
|
protected function makeOrderBy( $options ) { |
| 1222 |
|
if ( isset( $options['ORDER BY'] ) ) { |
| 1223 |
|
$ob = is_array( $options['ORDER BY'] ) |
| 1224 |
|
? implode( ',', $options['ORDER BY'] ) |
| 1225 |
|
: $options['ORDER BY']; |
| 1226 |
|
|
| 1227 |
|
return ' ORDER BY ' . $ob; |
| 1228 |
|
} |
| 1229 |
|
|
| 1230 |
|
return ''; |
| 1231 |
|
} |