getBottomList($params); $apps = ( new CoreAddonService() )->getList([ [ 'type', '=', 'app' ] ]); $bottom_list_keys = array_column($list, 'key'); // 排除没有底部导航的应用 foreach ($apps as $k => $v) { if (!in_array($v[ 'key' ], $bottom_list_keys)) { unset($apps[ $k ]); } } $apps = array_values($apps); // 单应用,排除 系统 底部导航设置 if (count($list) > 1 && count($apps) == 1) { foreach ($list as $k => $v) { if ($v[ 'key' ] = 'app') { unset($list[ $k ]); break; } } $list = array_values($list); } $res = []; foreach ($list as $k => $v) { $res[] = $this->getBottomConfig($v[ 'key' ]); } return $res; } /** * 获取底部导航配置 * @param $key * @return array */ public function getBottomConfig($key) { // 检测当前站点是多应用还是单应用 if ($key == 'app') { $apps = ( new CoreAddonService() )->getList([ [ 'type', '=', 'app' ] ]); $list = ( new CoreDiyConfigService() )->getBottomList(); $bottom_list_keys = array_column($list, 'key'); // 排除没有底部导航的应用 foreach ($apps as $k => $v) { if (!in_array($v[ 'key' ], $bottom_list_keys)) { unset($apps[ $k ]); } } $apps = array_values($apps); if (count($apps) == 1) { $key = $apps[ 0 ][ 'key' ]; } } return ( new CoreDiyConfigService() )->getBottomConfig($key); } /** * 获取启动页配置 * @return array */ public function getStartUpPageConfig($type) { return ( new CoreDiyConfigService() )->getStartUpPageConfig($type); } }