From 85b1b36d54c0bce81bd7de1bb987c92ad2d63459 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 23 May 2023 13:58:02 +0800 Subject: [PATCH] * Add return type. --- module/product/model.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/module/product/model.php b/module/product/model.php index a2dfa9a438..e01a69c2e6 100755 --- a/module/product/model.php +++ b/module/product/model.php @@ -1658,9 +1658,13 @@ class productModel extends model * @access public * @return void */ - public function setMenu(int $productID = 0, string|int $branch = '', string $extra = '') + public function setMenu(int $productID = 0, string|int $branch = '', string $extra = ''): void { - if(!defined('TUTORIAL') and $productID != 0 and !$this->checkPriv($productID)) return $this->accessDenied($this->lang->product->accessDenied); + if(!defined('TUTORIAL') and $productID != 0 and !$this->checkPriv($productID)) + { + $this->accessDenied($this->lang->product->accessDenied); + return; + } /* 用真实数据替换导航配置的占位符,并删除无用配置项。 */ $params = array('branch' => $branch);