- Remove repeat methods.

This commit is contained in:
caoyanyi
2023-12-16 17:19:45 +08:00
parent e3f865e997
commit b6fceec3b4
8 changed files with 3 additions and 103 deletions
+1 -1
View File
@@ -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)
{
-15
View File
@@ -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.
*
-14
View File
@@ -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
*
-21
View File
@@ -1,21 +0,0 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/gitea.class.php';
su('admin');
/**
title=测试giteaModel->gitList();
cid=1
pid=1
获取Gitea列表 >> 4
*/
$gitea = new giteaTest();
$orderBy = 'id_desc';
r($gitea->getList($orderBy)) && p('id') && e('4'); // 获取Gitea列表
+2 -2
View File
@@ -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)
{
-15
View File
@@ -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.
*
-14
View File
@@ -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
*
-21
View File
@@ -1,21 +0,0 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/gogs.class.php';
su('admin');
/**
title=测试gogsModel->gitList();
cid=1
pid=1
获取Gogs列表 >> 5
*/
$gogs = new gogsTest();
$orderBy = 'id_desc';
r($gogs->getList($orderBy)) && p('id') && e('5'); // 获取Gogs列表