* adjust for api.

This commit is contained in:
王怡栋
2021-11-26 13:28:45 +08:00
parent 294317ccfe
commit d41d6cf262
3 changed files with 12 additions and 3 deletions
+5 -1
View File
@@ -24,7 +24,11 @@ class bugEntry extends entry
$control->view($bugID);
$data = $this->getData();
$bug = $data->data->bug;
if(!$data or !isset($data->status)) return $this->send400('error');
if(isset($data->status) and $data->status == 'fail') return isset($data->code) and $data->code == 404 ? $this->send404() : $this->sendError(400, $data->message);
$bug = $data->data->bug;
/* Set product name */
$bug->productName = $data->data->product->name;
+5 -1
View File
@@ -23,7 +23,11 @@ class storyEntry extends Entry
$control = $this->loadController('story', 'view');
$control->view($storyID);
$data = $this->getData();
$data = $this->getData();
if(!$data or !isset($data->status)) return $this->send400('error');
if(isset($data->status) and $data->status == 'fail') return isset($data->code) and $data->code == 404 ? $this->send404() : $this->sendError(400, $data->message);
$story = $data->data->story;
if(!empty($story->children)) $story->children = array_values((array)$story->children);
+2 -1
View File
@@ -1865,9 +1865,10 @@ EOD;
{
$queryObjects = $this->dao->query($sql);
$objectList = array();
$key = 'id';
while($object = $queryObjects->fetch())
{
$key = (!$this->session->$typeOnlyCondition and $type == 'testcase' and isset($object->case)) ? 'case' : 'id';
if(!$this->session->$typeOnlyCondition and $type == 'testcase' and isset($object->case)) $key = 'case';
$id = $object->$key;
$objectList[$id] = $id;
}