123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?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 = [])
- {
- $site_id = $params['site_id'] ?? 0;
- $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($site_id);
- }
- return $res;
- }
- /**
- * 获取底部导航配置
- * @param $key
- * @return array
- */
- public function getBottomConfig(int $site_id)
- {
- return ( new CoreDiyConfigService() )->getBottomConfig($site_id);
- }
- /**
- * 获取启动页配置
- * @return array
- */
- public function getStartUpPageConfig($type)
- {
- return ( new CoreDiyConfigService() )->getStartUpPageConfig(0, $type);
- }
- }
|