PcService.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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\admin\channel;
  12. use app\dict\common\ChannelDict;
  13. use app\service\core\channel\CorePcService;
  14. use app\service\core\sys\CoreConfigService;
  15. use core\base\BaseAdminService;
  16. /**
  17. * 配置服务层
  18. * Class ConfigService
  19. * @package app\service\core\sys
  20. */
  21. class PcService extends BaseAdminService
  22. {
  23. //系统配置文件
  24. public $core_config_service;
  25. public function __construct()
  26. {
  27. parent::__construct();
  28. $this->core_config_service = new CoreConfigService();
  29. }
  30. /**
  31. * 设置pc信息
  32. * @param array $value
  33. * @return bool
  34. */
  35. public function setPc(array $value)
  36. {
  37. $data = [
  38. 'is_open' => $value['is_open']
  39. ];
  40. return $this->core_config_service->setConfig($this->request->defaultSiteId(),ChannelDict::PC, $data);
  41. }
  42. /**
  43. * 获取pc配置
  44. * @return mixed
  45. */
  46. public function getPc(){
  47. return (new CorePcService())->getPc($this->request->defaultSiteId());
  48. }
  49. }