* Refactor doc::getEditors method.

This commit is contained in:
tianshujie
2023-12-12 09:58:53 +08:00
parent 5da2f54420
commit 4e2b6f3f0c
+4 -3
View File
@@ -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');