Setting.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的多应用管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\adminapi\controller\shop\site;
  12. use app\service\admin\shop\site\SettingService;
  13. use core\base\BaseAdminController;
  14. /**
  15. * 店铺设置
  16. */
  17. class Setting extends BaseAdminController
  18. {
  19. /**
  20. * 获取店铺基本信息
  21. * @return \think\Response
  22. */
  23. public function getBasicInfo()
  24. {
  25. return success((new SettingService())->getBasicInfo());
  26. }
  27. /**
  28. * 修改店铺基本信息
  29. * @return \think\Response
  30. */
  31. public function setBasicInfo()
  32. {
  33. $data = $this->request->params([
  34. ['site_name', ''],
  35. ['phone', ''],
  36. ['logo', ''],
  37. ['icon', ''],
  38. ['keywords', ''],
  39. ['desc', ''],
  40. ['front_end_name', ''],
  41. ['front_end_logo', ''],
  42. ]);
  43. $this->validate($data, 'app\validate\site\Site.edit');
  44. (new SettingService())->setBasicInfo($data);
  45. return success('EDIT_SUCCESS');
  46. }
  47. /**
  48. * 获取店铺信息
  49. * @return \think\Response
  50. */
  51. public function getShopInfo()
  52. {
  53. return success((new SettingService())->getShopInfo());
  54. }
  55. }