mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 12:11:19 +00:00
do not group search result by tblFolders.id
This commit is contained in:
parent
f2ca92f48b
commit
84edc020ef
|
@ -593,9 +593,9 @@ class LetoDMS_Core_DMS {
|
|||
*/
|
||||
if($searchKey || $searchOwner || $searchCreateDate) {
|
||||
// Count the number of rows that the search will produce.
|
||||
$resArr = $this->db->getResultArray("SELECT COUNT(*) AS num ".$searchQuery." GROUP BY `tblFolders`.`id`");
|
||||
$resArr = $this->db->getResultArray("SELECT COUNT(*) AS num ".$searchQuery);
|
||||
$totalFolders = 0;
|
||||
if (is_numeric($resArr[0]["num"]) && $resArr[0]["num"]>0) {
|
||||
if ($resArr && isset($resArr[0]) && is_numeric($resArr[0]["num"]) && $resArr[0]["num"]>0) {
|
||||
$totalFolders = (integer)$resArr[0]["num"];
|
||||
}
|
||||
|
||||
|
@ -606,7 +606,7 @@ class LetoDMS_Core_DMS {
|
|||
// Only search if the offset is not beyond the number of folders
|
||||
if($totalFolders > $offset) {
|
||||
// Prepare the complete search query, including the LIMIT clause.
|
||||
$searchQuery = "SELECT DISTINCT `tblFolders`.* ".$searchQuery;
|
||||
$searchQuery = "SELECT DISTINCT `tblFolders`.* ".$searchQuery." GROUP BY `tblFolders`.`id`";
|
||||
|
||||
if($limit) {
|
||||
$searchQuery .= " LIMIT ".$offset.",".$limit;
|
||||
|
|
Loading…
Reference in New Issue
Block a user