Setting.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. ['latitude', ''],
  43. ['longitude', ''],
  44. ['province_id', ''],
  45. ['city_id', ''],
  46. ['district_id', ''],
  47. ['address', ''],
  48. ['full_address', ''],
  49. ['business_hours', '']
  50. ]);
  51. $this->validate($data, 'app\validate\site\Site.site_set');
  52. (new SettingService())->setBasicInfo($data);
  53. return success('EDIT_SUCCESS');
  54. }
  55. /**
  56. * 获取店铺信息
  57. * @return \think\Response
  58. */
  59. public function getShopInfo()
  60. {
  61. return success((new SettingService())->getShopInfo());
  62. }
  63. }