WebPageSettingLogic.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\adminapi\logic\channel;
  15. use app\common\logic\BaseLogic;
  16. use app\common\service\ConfigService;
  17. /**
  18. * H5设置逻辑层
  19. * Class HFiveSettingLogic
  20. * @package app\adminapi\logic\setting\h5
  21. */
  22. class WebPageSettingLogic extends BaseLogic
  23. {
  24. /**
  25. * @notes 获取H5设置
  26. * @return array
  27. * @author 段誉
  28. * @date 2022/3/29 10:34
  29. */
  30. public static function getConfig()
  31. {
  32. $config = [
  33. // 渠道状态 0-关闭 1-开启
  34. 'status' => ConfigService::get('web_page', 'status', 1),
  35. // 关闭后渠道后访问页面 0-空页面 1-自定义链接
  36. 'page_status' => ConfigService::get('web_page', 'page_status', 0),
  37. // 自定义链接
  38. 'page_url' => ConfigService::get('web_page', 'page_url', ''),
  39. 'url' => request()->domain() . '/mobile'
  40. ];
  41. return $config;
  42. }
  43. /**
  44. * @notes H5设置
  45. * @param $params
  46. * @author 段誉
  47. * @date 2022/3/29 10:34
  48. */
  49. public static function setConfig($params)
  50. {
  51. ConfigService::set('web_page', 'status', $params['status']);
  52. ConfigService::set('web_page', 'page_status', $params['page_status']);
  53. ConfigService::set('web_page', 'page_url', $params['page_url']);
  54. }
  55. }