From 4e2b6f3f0c9a769b0cec44db870d22523b9b680a Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 12 Dec 2023 09:58:43 +0800 Subject: [PATCH] * Refactor doc::getEditors method. --- module/doc/model.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/doc/model.php b/module/doc/model.php index 2b01678ff3..5109093724 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -2653,18 +2653,19 @@ class docModel extends model } /** - * Get editors by doc id. + * 获取编辑过文档的用户列表。 + * Get editors of a document. * * @param int $docID * @access public * @return array */ - public function getEditors($docID = 0) + public function getEditors(int $docID = 0): array { if(!$docID) return array(); $actions = $this->dao->select('*')->from(TABLE_ACTION) ->where('objectType')->eq('doc') - ->andWhere('objectID')->eq((int)$docID) + ->andWhere('objectID')->eq($docID) ->andWhere('action')->in('edited') ->orderBy('date_desc') ->fetchAll('id');