|
@@ 1176-1181 (lines=6) @@
|
| 1173 |
|
*/ |
| 1174 |
|
public function makeGroupByWithHaving( $options ) { |
| 1175 |
|
$sql = ''; |
| 1176 |
|
if ( isset( $options['GROUP BY'] ) ) { |
| 1177 |
|
$gb = is_array( $options['GROUP BY'] ) |
| 1178 |
|
? implode( ',', $options['GROUP BY'] ) |
| 1179 |
|
: $options['GROUP BY']; |
| 1180 |
|
$sql .= ' GROUP BY ' . $gb; |
| 1181 |
|
} |
| 1182 |
|
if ( isset( $options['HAVING'] ) ) { |
| 1183 |
|
$having = is_array( $options['HAVING'] ) |
| 1184 |
|
? $this->makeList( $options['HAVING'], self::LIST_AND ) |
|
@@ 1182-1187 (lines=6) @@
|
| 1179 |
|
: $options['GROUP BY']; |
| 1180 |
|
$sql .= ' GROUP BY ' . $gb; |
| 1181 |
|
} |
| 1182 |
|
if ( isset( $options['HAVING'] ) ) { |
| 1183 |
|
$having = is_array( $options['HAVING'] ) |
| 1184 |
|
? $this->makeList( $options['HAVING'], self::LIST_AND ) |
| 1185 |
|
: $options['HAVING']; |
| 1186 |
|
$sql .= ' HAVING ' . $having; |
| 1187 |
|
} |
| 1188 |
|
|
| 1189 |
|
return $sql; |
| 1190 |
|
} |
|
@@ 1201-1207 (lines=7) @@
|
| 1198 |
|
* @since 1.21 |
| 1199 |
|
*/ |
| 1200 |
|
public function makeOrderBy( $options ) { |
| 1201 |
|
if ( isset( $options['ORDER BY'] ) ) { |
| 1202 |
|
$ob = is_array( $options['ORDER BY'] ) |
| 1203 |
|
? implode( ',', $options['ORDER BY'] ) |
| 1204 |
|
: $options['ORDER BY']; |
| 1205 |
|
|
| 1206 |
|
return ' ORDER BY ' . $ob; |
| 1207 |
|
} |
| 1208 |
|
|
| 1209 |
|
return ''; |
| 1210 |
|
} |