From a7a1ff52bf386ccbd99b08de9d6746d210c509f1 Mon Sep 17 00:00:00 2001
From: tianshujie
Date: Wed, 22 Mar 2023 13:57:36 +0800
Subject: [PATCH] * Code for finish task #87405.
---
module/doc/control.php | 2 +-
module/doc/model.php | 8 ++++----
module/doc/view/doclist.html.php | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/module/doc/control.php b/module/doc/control.php
index 99501c2f05..9fbca27d6b 100755
--- a/module/doc/control.php
+++ b/module/doc/control.php
@@ -1303,7 +1303,7 @@ class doc extends control
else
{
$this->session->set('objectName', $this->lang->doc->common, 'admin');
- $this->view->docs = $browseType == 'bySearch' ? $this->doc->getDocsBySearch($type, $objectID, $libID, $queryID, $pager) : $this->doc->getDocs($libID, $moduleID, $orderBy, $pager);
+ $this->view->docs = $browseType == 'bySearch' ? $this->doc->getDocsBySearch($type, $objectID, $libID, $queryID, $orderBy, $pager) : $this->doc->getDocs($libID, $moduleID, $orderBy, $pager);
}
$this->view->title = $title;
diff --git a/module/doc/model.php b/module/doc/model.php
index 157b2c4088..4190444bf9 100644
--- a/module/doc/model.php
+++ b/module/doc/model.php
@@ -2802,16 +2802,16 @@ EOT;
/**
* Get docs by search.
*
- * @param string $type
+ * @param string $type product|project|execution|custom|book
* @param int $objectID
* @param int $libID
* @param int $queryID
+ * @param string $orderBy
* @param object $pager
- *
* @access public
* @return array
*/
- public function getDocsBySearch($type, $objectID, $libID, $queryID, $pager)
+ public function getDocsBySearch($type, $objectID, $libID, $queryID, $orderBy = 'id_desc', $pager = null)
{
$lib = $this->getLibById($libID);
$queryName = $type . 'libDocQuery';
@@ -2842,7 +2842,7 @@ EOT;
->andWhere($query)
->andWhere('lib')->in(array_keys($libs))
->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi()
- ->orderBy('id_desc')
+ ->orderBy($orderBy)
->page($pager)
->fetchAll('id');
}
diff --git a/module/doc/view/doclist.html.php b/module/doc/view/doclist.html.php
index a9de9f21a4..0310d7c1eb 100644
--- a/module/doc/view/doclist.html.php
+++ b/module/doc/view/doclist.html.php
@@ -54,7 +54,7 @@
-recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
+recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>