PublicController.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\api\controller\pc;
  12. use app\Request;
  13. use app\services\pc\PublicServices;
  14. class PublicController
  15. {
  16. protected $services;
  17. public function __construct(PublicServices $services)
  18. {
  19. $this->services = $services;
  20. }
  21. /**
  22. * 获取城市数据
  23. * @param Request $request
  24. * @return mixed
  25. */
  26. public function getCity(Request $request)
  27. {
  28. list($pid) = $request->getMore([
  29. [['pid', 'd'], 0],
  30. ], true);
  31. return app('json')->success($this->services->getCity($pid));
  32. }
  33. /**
  34. * 获取公司信息
  35. * @return mixed
  36. */
  37. public function getCompanyInfo()
  38. {
  39. $data['contact_number'] = sys_config('contact_number');
  40. $data['company_address'] = sys_config('company_address');
  41. $data['copyright'] = sys_config('nncnL_crmeb_copyright', '');
  42. $data['record_No'] = sys_config('record_No');
  43. $data['site_name'] = sys_config('site_name');
  44. $data['site_keywords'] = sys_config('site_keywords');
  45. $data['site_description'] = sys_config('site_description');
  46. $data['network_security'] = sys_config('network_security');
  47. $data['network_security_url'] = sys_config('network_security_url');
  48. $data['icp_url'] = sys_config('icp_url');
  49. $logoUrl = sys_config('pc_logo');
  50. if (strstr($logoUrl, 'http') === false && $logoUrl) {
  51. $logoUrl = sys_config('site_url') . $logoUrl;
  52. }
  53. $logoUrl = str_replace('\\', '/', $logoUrl);
  54. $data['logoUrl'] = $logoUrl;
  55. return app('json')->success($data);
  56. }
  57. /**
  58. * 获取关注微信二维码
  59. * @return mixed
  60. */
  61. public function getWechatQrcode()
  62. {
  63. $data['wechat_qrcode'] = sys_config('wechat_qrcode');
  64. return app('json')->success($data);
  65. }
  66. }