* adjust for vs code and php8.0.

This commit is contained in:
王怡栋
2021-12-22 15:24:47 +08:00
parent 2eac7ba0d1
commit 49bfd2dd18
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -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;
}