fix missing count only condition

master
Jean-Christian Paul Denis 2023-04-23 01:16:28 +02:00
parent a96b694ed1
commit a52c17e6ff
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
1 changed files with 6 additions and 4 deletions

View File

@ -66,7 +66,7 @@ class Utils
$sql = $ext_sql ? clone $ext_sql : new SelectStatement(); $sql = $ext_sql ? clone $ext_sql : new SelectStatement();
if ($count_only) { if ($count_only) {
$sql->column($sql->count($sql->unique('T.periodical_id'))); $sql->column($sql->count('T.periodical_id'));
} else { } else {
if (!empty($params['columns']) && is_array($params['columns'])) { if (!empty($params['columns']) && is_array($params['columns'])) {
$sql->columns($params['columns']); $sql->columns($params['columns']);
@ -259,8 +259,8 @@ class Utils
$params['sql'] = ''; $params['sql'] = '';
} }
$sql if (!$count_only) {
->columns([ $sql->columns([
'T.periodical_id', 'T.periodical_id',
'T.periodical_title', 'T.periodical_title',
'T.periodical_type', 'T.periodical_type',
@ -269,7 +269,9 @@ class Utils
'T.periodical_pub_int', 'T.periodical_pub_int',
'T.periodical_pub_nb', 'T.periodical_pub_nb',
]) ]);
}
$sql
->join( ->join(
(new JoinStatement()) (new JoinStatement())
->left() ->left()