Setting.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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\model\XcxHomeSetting;
  14. use app\api\service\Setting as SettingService;
  15. /**
  16. * 商城设置控制器
  17. * Class Setting
  18. * @package app\store\controller
  19. */
  20. class Setting extends Controller
  21. {
  22. /**
  23. * 商城公共设置(仅展示可公开的信息)
  24. * @return array|\think\response\Json
  25. * @throws \think\db\exception\DataNotFoundException
  26. * @throws \think\db\exception\DbException
  27. * @throws \think\db\exception\ModelNotFoundException
  28. */
  29. public function data()
  30. {
  31. $service = new SettingService;
  32. $setting = $service->getPublic();
  33. return $this->renderSuccess(compact('setting'));
  34. }
  35. public function getHomePage(){
  36. $mod = new XcxHomeSetting();
  37. $page = $mod->getPage();
  38. return $this->renderSuccess(compact('page'));
  39. }
  40. }