+ Add modules api.

This commit is contained in:
zhujinyong
2022-03-22 09:54:35 +08:00
parent 44bb282b85
commit e3ec91da2a
3 changed files with 51 additions and 1 deletions
+6 -1
View File
@@ -50,7 +50,12 @@ class tree extends control
if(strpos('story|bug|case', $viewType) !== false)
{
$product = $this->loadModel('product')->getById($rootID);
if(empty($product)) $this->locate($this->createLink('product', 'create'));
if(empty($product))
{
if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'fail', 'message' => 'No product.'));
$this->locate($this->createLink('product', 'create'));
}
if(!empty($product->type) && $product->type != 'normal')
{
$branches = $this->loadModel('branch')->getPairs($product->id);