From afcccc65b1486387b1b4706eb6b9543cb58d6d60 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Fri, 25 Apr 2025 13:55:03 +0800 Subject: [PATCH] * [task#141999,doing,0.5h] Show the top template in home page. --- module/doc/model.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/module/doc/model.php b/module/doc/model.php index aaf87e24ac..2f834758a4 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -4126,12 +4126,22 @@ class docModel extends model return $scopeTemplates; } + /** + * 获取范围内的最近顶层文档模板。 + * Get the recent top template of scope. + * + * @param int $scopeID + * @param int $limit + * @access public + * @return array + */ public function getHotTemplates($scopeID = 0, $limit = 0) { return $this->dao->select('*, CASE WHEN addedDate > editedDate THEN addedDate ELSE editedDate END as hotDate')->from(TABLE_DOC) ->where('templateType')->ne('') ->andWhere('deleted')->eq('0') ->andWhere('status')->eq('normal') + ->andWhere('parent')->eq(0) ->beginIF($scopeID)->andWhere('lib')->eq($scopeID)->fi() ->orderBy('hotDate_desc') ->beginIF($limit)->limit($limit)->fi()