*Finish task#48107,48106,48105,48103 and adjust code

This commit is contained in:
zenggang
2022-01-25 01:13:49 +00:00
parent 461940c671
commit 4ab46cb2ea
6 changed files with 41 additions and 14 deletions
+4 -3
View File
@@ -669,11 +669,12 @@ class gitlabModel extends model
/**
* Get projects of one gitlab.
*
* @param int $gitlabID
* @param int $gitlabID
* @param string $simple
* @access public
* @return array
*/
public function apiGetProjects($gitlabID)
public function apiGetProjects($gitlabID, $simple = 'true')
{
$apiRoot = $this->getApiRoot($gitlabID);
if(!$apiRoot) return array();
@@ -683,7 +684,7 @@ class gitlabModel extends model
$allResults = array();
for($page = 1; true; $page++)
{
$results = json_decode(commonModel::http($url . "&page={$page}&per_page=100"));
$results = json_decode(commonModel::http($url . "&simple={$simple}&page={$page}&per_page=100"));
if(!is_array($results)) break;
if(!empty($results)) $allResults = array_merge($allResults, $results);
if(count($results)<100 or $page > 10) break;