[Web] fix datatables ssp queries
This commit is contained in:
parent
bd6a7210b7
commit
cc3adbe78c
@ -291,13 +291,14 @@ class SSP {
|
|||||||
FROM `$table` AS `$tablesAS`
|
FROM `$table` AS `$tablesAS`
|
||||||
$join
|
$join
|
||||||
$where
|
$where
|
||||||
|
GROUP BY `{$tablesAS}`.`{$primaryKey}`
|
||||||
$order
|
$order
|
||||||
$limit"
|
$limit"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Data set length after filtering
|
// Data set length after filtering
|
||||||
$resFilterLength = self::sql_exec( $db, $bindings,
|
$resFilterLength = self::sql_exec( $db, $bindings,
|
||||||
"SELECT COUNT(`{$tablesAS}`.`{$primaryKey}`)
|
"SELECT COUNT(DISTINCT `{$tablesAS}`.`{$primaryKey}`)
|
||||||
FROM `$table` AS `$tablesAS`
|
FROM `$table` AS `$tablesAS`
|
||||||
$join
|
$join
|
||||||
$where"
|
$where"
|
||||||
@ -411,12 +412,11 @@ class SSP {
|
|||||||
|
|
||||||
// Data set length after filtering
|
// Data set length after filtering
|
||||||
$resFilterLength = self::sql_exec( $db, $bindings,
|
$resFilterLength = self::sql_exec( $db, $bindings,
|
||||||
"SELECT COUNT(`{$tablesAS}`.`{$primaryKey}`)
|
"SELECT COUNT(DISTINCT `{$tablesAS}`.`{$primaryKey}`)
|
||||||
FROM `$table` AS `$tablesAS`
|
FROM `$table` AS `$tablesAS`
|
||||||
$join
|
$join
|
||||||
$join_filter
|
$join_filter
|
||||||
$where
|
$where"
|
||||||
GROUP BY `{$tablesAS}`.`{$primaryKey}`"
|
|
||||||
);
|
);
|
||||||
$recordsFiltered = (isset($resFilterLength[0])) ? $resFilterLength[0][0] : 0;
|
$recordsFiltered = (isset($resFilterLength[0])) ? $resFilterLength[0][0] : 0;
|
||||||
|
|
||||||
@ -424,10 +424,9 @@ class SSP {
|
|||||||
$resTotalLength = self::sql_exec( $db, $bindings,
|
$resTotalLength = self::sql_exec( $db, $bindings,
|
||||||
"SELECT COUNT(`{$tablesAS}`.`{$primaryKey}`)
|
"SELECT COUNT(`{$tablesAS}`.`{$primaryKey}`)
|
||||||
FROM `$table` AS `$tablesAS`
|
FROM `$table` AS `$tablesAS`
|
||||||
$join
|
$join
|
||||||
$join_filter
|
$join_filter
|
||||||
$where
|
$where"
|
||||||
GROUP BY `{$tablesAS}`.`{$primaryKey}`"
|
|
||||||
);
|
);
|
||||||
$recordsTotal = (isset($resTotalLength[0])) ? $resTotalLength[0][0] : 0;
|
$recordsTotal = (isset($resTotalLength[0])) ? $resTotalLength[0][0] : 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user