* Finish task #41751.

This commit is contained in:
tianshujie98
2021-08-23 15:54:03 +08:00
parent a075fd552e
commit a6ce38ef9c
2 changed files with 9 additions and 11 deletions
+6 -4
View File
@@ -202,9 +202,11 @@ class search extends control
$type = (empty($type) or $type[0] == 'all') ? 'all' : $type;
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $this->config->search->recPerPage, $pageID);
$begin = time();
$result = $this->search->getList($words, $pager, $type);
$begin = time();
$results = $this->search->getList($words, $type);
$recTotal = count($results);
$pager = new pager($recTotal, $this->config->search->recPerPage, $pageID);
$results = array_chunk($results, $pager->recPerPage);
/* Set session. */
$uri = inlink('index', "recTotal=$pager->recTotal&pageID=$pager->pageID");
@@ -237,7 +239,7 @@ class search extends control
if(strpos($this->server->http_referer, 'search') === false) $this->session->set('referer', $this->server->http_referer);
$this->view->results = $result;
$this->view->results = empty($results) ? $results : $results[$pageID - 1];
$this->view->consumed = time() - $begin;
$this->view->title = $this->lang->search->index;
$this->view->type = $type;