From b6fceec3b4d40995975ab88ccae97be101c270db Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Sat, 16 Dec 2023 17:19:43 +0800 Subject: [PATCH] - Remove repeat methods. --- module/gitea/control.php | 2 +- module/gitea/model.php | 15 --------------- module/gitea/test/gitea.class.php | 14 -------------- module/gitea/test/model/getlist.php | 21 --------------------- module/gogs/control.php | 4 ++-- module/gogs/model.php | 15 --------------- module/gogs/test/gogs.class.php | 14 -------------- module/gogs/test/model/getlist.php | 21 --------------------- 8 files changed, 3 insertions(+), 103 deletions(-) delete mode 100755 module/gitea/test/model/getlist.php delete mode 100755 module/gogs/test/model/getlist.php diff --git a/module/gitea/control.php b/module/gitea/control.php index ad534c70f0..cac5ac341d 100644 --- a/module/gitea/control.php +++ b/module/gitea/control.php @@ -44,7 +44,7 @@ class gitea extends control $pager = new pager($recTotal, $recPerPage, $pageID); /* Admin user don't need bind. */ - $giteaList = $this->gitea->getList($orderBy, $pager); + $giteaList = $this->loadModel('pipeline')->getList('gitea', $orderBy, $pager); $myGiteas = $this->gitea->getGiteaListByAccount(); foreach($giteaList as $gitea) { diff --git a/module/gitea/model.php b/module/gitea/model.php index f6af4514d1..032e5f5b46 100644 --- a/module/gitea/model.php +++ b/module/gitea/model.php @@ -20,21 +20,6 @@ class giteaModel extends model public $developerAccess = 30; public $maintainerAccess = 40; - /** - * Get gitea list. - * - * @param string $orderBy - * @param object $pager - * @access public - * @return array - */ - public function getList($orderBy = 'id_desc', $pager = null) - { - $giteaList = $this->loadModel('pipeline')->getList('gitea', $orderBy, $pager); - - return $giteaList; - } - /** * Get gitea pairs. * diff --git a/module/gitea/test/gitea.class.php b/module/gitea/test/gitea.class.php index f20e7bff9d..729afe4753 100644 --- a/module/gitea/test/gitea.class.php +++ b/module/gitea/test/gitea.class.php @@ -10,20 +10,6 @@ class giteaTest $this->gitea = $this->tester->loadModel('gitea'); } - /** - * Get gitea list. - * - * @param string $orderBy - * @access public - * @return object - */ - public function getList($orderBy = 'id_desc') - { - $gitea = $this->gitea->getList($orderBy); - if(empty($gitea)) return 0; - return array_shift($gitea); - } - /** * Get gitea pairs * diff --git a/module/gitea/test/model/getlist.php b/module/gitea/test/model/getlist.php deleted file mode 100755 index d086be3851..0000000000 --- a/module/gitea/test/model/getlist.php +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env php -gitList(); -cid=1 -pid=1 - -获取Gitea列表 >> 4 - -*/ - -$gitea = new giteaTest(); - -$orderBy = 'id_desc'; -r($gitea->getList($orderBy)) && p('id') && e('4'); // 获取Gitea列表 - diff --git a/module/gogs/control.php b/module/gogs/control.php index 8c44a3d776..263cf7ac85 100644 --- a/module/gogs/control.php +++ b/module/gogs/control.php @@ -38,11 +38,11 @@ class gogs extends control */ public function browse($orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { - $this->app->loadClass('pager', $static = true); + $this->app->loadClass('pager', true); $pager = new pager($recTotal, $recPerPage, $pageID); /* Admin user don't need bind. */ - $gogsList = $this->gogs->getList($orderBy, $pager); + $gogsList = $this->loadModel('pipeline')->getList('gogs', $orderBy, $pager); $myGogses = $this->gogs->getGogsListByAccount(); foreach($gogsList as $gogs) { diff --git a/module/gogs/model.php b/module/gogs/model.php index 74d31775b2..4b9f41a178 100644 --- a/module/gogs/model.php +++ b/module/gogs/model.php @@ -12,21 +12,6 @@ class gogsModel extends model { - /** - * Get gogs list. - * - * @param string $orderBy - * @param object $pager - * @access public - * @return array - */ - public function getList($orderBy = 'id_desc', $pager = null) - { - $gogsList = $this->loadModel('pipeline')->getList('gogs', $orderBy, $pager); - - return $gogsList; - } - /** * Get gogs pairs. * diff --git a/module/gogs/test/gogs.class.php b/module/gogs/test/gogs.class.php index 2470e131cd..c3ded018ab 100644 --- a/module/gogs/test/gogs.class.php +++ b/module/gogs/test/gogs.class.php @@ -10,20 +10,6 @@ class gogsTest $this->gogs = $this->tester->loadModel('gogs'); } - /** - * Get gogs list. - * - * @param string $orderBy - * @access public - * @return object - */ - public function getList($orderBy = 'id_desc') - { - $gogs = $this->gogs->getList($orderBy); - if(empty($gogs)) return 0; - return array_shift($gogs); - } - /** * Get gogs pairs * diff --git a/module/gogs/test/model/getlist.php b/module/gogs/test/model/getlist.php deleted file mode 100755 index 60dec8d46f..0000000000 --- a/module/gogs/test/model/getlist.php +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env php -gitList(); -cid=1 -pid=1 - -获取Gogs列表 >> 5 - -*/ - -$gogs = new gogsTest(); - -$orderBy = 'id_desc'; -r($gogs->getList($orderBy)) && p('id') && e('5'); // 获取Gogs列表 -