ConfigService.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\service\api\sys;
  12. use app\service\core\sys\CoreConfigService;
  13. use app\service\core\sys\CoreSysConfigService;
  14. use core\base\BaseApiService;
  15. /**
  16. * 配置服务层
  17. * Class ConfigService
  18. * @package app\service\core\sys
  19. */
  20. class ConfigService extends BaseApiService
  21. {
  22. //系统配置文件
  23. public function __construct()
  24. {
  25. parent::__construct();
  26. }
  27. /**
  28. * 获取版权信息(网站整体,不按照站点设置)
  29. * @return array|mixed
  30. */
  31. public function getCopyright()
  32. {
  33. return (new CoreSysConfigService())->getCopyright(0);
  34. }
  35. /**
  36. * 获取前端域名
  37. * @return array|string[]
  38. */
  39. public function getSceneDomain()
  40. {
  41. return ( new CoreSysConfigService() )->getSceneDomain();
  42. }
  43. /**
  44. * 获取服务信息
  45. * @return array|mixed
  46. */
  47. public function getService()
  48. {
  49. $info = ( new CoreConfigService() )->getConfig($this->request->defaultSiteId(), 'SERVICE_INFO');
  50. if (empty($info)) {
  51. $info = [];
  52. $info[ 'value' ] = [
  53. 'wechat_code' => '',
  54. 'enterprise_wechat' => '',
  55. 'tel' => '',
  56. ];
  57. }
  58. return $info[ 'value' ];
  59. }
  60. /**
  61. * 获取手机端首页列表
  62. * @param $data
  63. * @return array
  64. */
  65. public function getWapIndexList($data = [])
  66. {
  67. return ( new CoreSysConfigService() )->getWapIndexList($data);
  68. }
  69. public function getWebSite()
  70. {
  71. $info = ( new CoreConfigService() )->getConfigValue(0,'WEB_SITE_INFO');
  72. if (empty($info)) {
  73. $info = [
  74. 'site_name' => '',
  75. 'logo' => '',
  76. 'desc' => '',
  77. 'latitude' => '',
  78. 'longitude' => '',
  79. 'province_id' => 0,
  80. 'city_id' => 0,
  81. 'district_id' => 0,
  82. 'address' => '',
  83. 'full_address' => '',
  84. 'phone' => '',
  85. 'business_hours' => '',
  86. 'front_end_name' => '',
  87. 'front_end_logo' => '',
  88. 'icon' => '',
  89. ];
  90. }
  91. return $info;
  92. }
  93. /**
  94. * 获取地图key
  95. * @return array|mixed
  96. */
  97. public function getMap()
  98. {
  99. return (new CoreSysConfigService())->getMap($this->site_id);
  100. }
  101. }