From 400dc08f299ce80ef479554402694520b1ed1f8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=96=E5=8F=AB?= <392494244@qq.com> Date: Mon, 11 Dec 2023 10:07:19 +0800 Subject: [PATCH] 1 --- app/store/controller/food/Controller.php | 29 ++++++++++++------------ 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/app/store/controller/food/Controller.php b/app/store/controller/food/Controller.php index 5d78f25..75b9982 100644 --- a/app/store/controller/food/Controller.php +++ b/app/store/controller/food/Controller.php @@ -1,4 +1,5 @@ getUserInfo();// 获取登录信息 $this->getRouteInfo();// 当前路由信息 $this->checkLogin();// 验证登录状态 @@ -52,7 +53,7 @@ class Controller extends \app\BaseController { // 控制器名称 $this->controller = uncamelize($this->request->controller()); - $controller = str_replace($this->app_type . '.','',$this->controller); //取消掉 'food.' + $controller = str_replace($this->app_type . '.', '', $this->controller); //取消掉 'food.' // 方法名称 $this->action = $this->request->action(); // 控制器分组 (用于定义所属模块) @@ -84,7 +85,7 @@ class Controller extends \app\BaseController $this->shop_mode = $this->user['applet']['shop_mode']['value'];//门店模式 $this->applet_id = $this->user['applet']['applet_id'];//应用ID //如果是单门店 - if($this->shop_mode == 10){ + if ($this->shop_mode == 10) { $shop = Shop::getShop(); $this->shop_id = $shop['shop_id']; } @@ -100,7 +101,7 @@ class Controller extends \app\BaseController // 输出到view View::assign([ 'base_url' => base_url(), // 当前站点域名 - 'web' => SettingModel::getItem('web',0), //站点设置 + 'web' => SettingModel::getItem('web', 0), //站点设置 'store_url' => '/store/' . $this->app_type . '.', // 后台模块url 'group' => $this->group, 'menus' => $this->menus(), // 后台菜单 @@ -108,7 +109,7 @@ class Controller extends \app\BaseController 'app_type' => $this->app_type, //小程序类型 'applet_id' => $this->applet_id, //小程序ID 'logout' => 'applet', //退出登录方式 applet=小程序退出 logout=其他管理端退出 - 'app_name' => '河马点单',//后台管理菜单名称 + 'app_name' => '点单',//后台管理菜单名称 'version' => $info['version'] ]); } @@ -118,10 +119,10 @@ class Controller extends \app\BaseController */ private function menus() { - foreach ($data = Config($this->app_type) as $group => $first) { + foreach ($data = Config($this->app_type) as $group => $first) { $data[$group]['active'] = $group === $this->group; - //$data[0]['active'] + //$data[0]['active'] // 遍历:二级菜单 if (isset($first['submenu'])) { foreach ($first['submenu'] as $secondKey => $second) { @@ -139,7 +140,7 @@ class Controller extends \app\BaseController $thirdUris[] = $third['index']; } $data[$group]['submenu'][$secondKey]['submenu'][$thirdKey]['active'] = in_array($this->routeUri, $thirdUris); - $data[$group]['submenu'][$secondKey]['active'] = in_array($this->routeUri, $secondUris); + $data[$group]['submenu'][$secondKey]['active'] = in_array($this->routeUri, $secondUris); } } else { if (isset($second['uris'])) @@ -149,7 +150,7 @@ class Controller extends \app\BaseController } // 二级菜单:active !isset($data[$group]['submenu'][$secondKey]['active']) - && $data[$group]['submenu'][$secondKey]['active'] = in_array($this->routeUri, $secondUris); + && $data[$group]['submenu'][$secondKey]['active'] = in_array($this->routeUri, $secondUris); } } }