1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- // +----------------------------------------------------------------------
- // | Niucloud-admin 企业快速开发的saas管理平台
- // +----------------------------------------------------------------------
- // | 官方网址:https://www.niucloud.com
- // +----------------------------------------------------------------------
- // | niucloud团队 版权所有 开源版本可自由商用
- // +----------------------------------------------------------------------
- // | Author: Niucloud Team
- // +----------------------------------------------------------------------
- namespace app\service\api\diy;
- use app\service\core\diy\CoreDiyConfigService;
- use app\service\core\site\CoreSiteService;
- use core\base\BaseApiService;
- /**
- * 自定义页面相关配置服务层
- * Class DiyConfigService
- * @package app\service\admin\diy
- */
- class DiyConfigService extends BaseApiService
- {
- /**
- * 获取底部导航列表
- * @param array $params
- * @return array|mixed
- */
- public function getBottomList($params = [])
- {
- $list = ( new CoreDiyConfigService() )->getBottomList($params);
- $site_addon = ( new CoreSiteService() )->getSiteCache($this->request->defaultSiteId());
- // 单应用,排除 系统 底部导航设置
- if (count($list) > 1 && count($site_addon[ '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()
- {
- return ( new CoreDiyConfigService() )->getBottomConfig(0);
- }
- /**
- * 获取启动页配置
- * @return array
- */
- public function getStartUpPageConfig($type)
- {
- return ( new CoreDiyConfigService() )->getStartUpPageConfig(0, $type);
- }
- }
|