diff --git a/module/dept/model.php b/module/dept/model.php index 3a6a9eb89f..fe0996ca35 100644 --- a/module/dept/model.php +++ b/module/dept/model.php @@ -376,7 +376,7 @@ class deptModel extends model * @access public * @return array */ - public function getUsers($browseType = 'inside', $deptID, $pager = null, $orderBy = 'id') + public function getUsers($browseType = 'inside', $deptID = 0, $pager = null, $orderBy = 'id') { return $this->dao->select('*')->from(TABLE_USER) ->where('deleted')->eq(0) diff --git a/module/product/control.php b/module/product/control.php index 569a8ec0fa..a14047daf7 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -31,7 +31,8 @@ class product extends control /* Get all products, if no, goto the create page. */ $this->products = $this->product->getPairs('nocode|all'); - if(empty($this->products) and strpos(',create,index,showerrornone,ajaxgetdropmenu,kanban', $this->methodName) === false and $this->app->getViewType() != 'mhtml') $this->locate($this->createLink('product', 'create')); + $isAPI = (defined('RUN_MODE') && RUN_MODE == 'api'); + if(empty($this->products) and strpos(',create,index,showerrornone,ajaxgetdropmenu,kanban', $this->methodName) === false and $this->app->getViewType() != 'mhtml' and !$isAPI) $this->locate($this->createLink('product', 'create')); $this->view->products = $this->products; }