Setting.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2021 https://www.yiovo.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: 萤火科技 <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types = 1);
  12. namespace app\api\controller;
  13. use app\api\service\Setting as SettingService;
  14. /**
  15. * 商城设置控制器
  16. * Class Setting
  17. * @package app\store\controller
  18. */
  19. class Setting extends Controller
  20. {
  21. /**
  22. * 商城公共设置(仅展示可公开的信息)
  23. * @return array|\think\response\Json
  24. * @throws \think\db\exception\DataNotFoundException
  25. * @throws \think\db\exception\DbException
  26. * @throws \think\db\exception\ModelNotFoundException
  27. */
  28. public function data()
  29. {
  30. $service = new SettingService;
  31. $setting = $service->getPublic();
  32. return $this->renderSuccess(compact('setting'));
  33. }
  34. }