* Add unitcase.

This commit is contained in:
liyuchun
2022-05-09 07:43:07 +00:00
parent 4fcdc3c728
commit e74e7c90a1
3 changed files with 21 additions and 6 deletions
+6 -3
View File
@@ -375,9 +375,12 @@ class apiModel extends model
public function getApiListByRelease($release, $where = '1 = 1 ')
{
$strJoin = array();
foreach($release->snap['apis'] as $api)
if(isset($release->snap['apis']))
{
$strJoin[] = "(spec.doc = {$api['id']} and spec.version = {$api['version']} )";
foreach($release->snap['apis'] as $api)
{
$strJoin[] = "(spec.doc = {$api['id']} and spec.version = {$api['version']} )";
}
}
if($strJoin) $where .= 'and (' . implode(' or ', $strJoin) . ')';
@@ -404,7 +407,7 @@ class apiModel extends model
$rel = $this->getRelease(0, 'byId', $release);
$where = "1=1 and lib = $libID ";
if($moduleID > 0)
if($moduleID > 0 and isset($rel->snap['modules']))
{
$sub = array();
foreach($rel->snap['modules'] as $module)