From ff3af11733793a560393b49cb05cf6fd4b9b91b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Tue, 29 May 2018 10:38:05 +0800 Subject: [PATCH] * Finish task#4241. --- module/doc/model.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/module/doc/model.php b/module/doc/model.php index 2b7597944a..3ac158f868 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -382,16 +382,19 @@ class docModel extends model { if($this->session->searchDoc == false) return array(); $docIdList = $this->getPrivDocs($libID, $moduleID); - $docs = $this->dao->select('*')->from(TABLE_DOC) - ->where('id')->in($docIdList) - ->andWhere('title')->like("%{$this->session->searchDoc}%") - ->andWhere('lib')->in($allLibs) + $docs = $this->dao->select('t1.*')->from(TABLE_DOC)->alias('t1') + ->leftJoin(TABLE_DOCCONTENT)->alias('t2')->on('t2.doc = t1.id') + ->where('t1.deleted')->eq(0) + ->andWhere('t1.id')->in($docIdList) + ->andWhere('t1.title', true)->like("%{$this->session->searchDoc}%") + ->orWhere('t2.content')->like("%{$this->session->searchDoc}%")->markRight(1) + ->andWhere('t1.lib')->in($allLibs) ->orderBy($sort) ->page($pager) ->fetchAll(); } - $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'doc'); + $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'doc', false); if(!$docs) return array(); foreach($docs as $index => $doc)