SettingService.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的多应用管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\service\admin\shop\site;
  12. use app\service\admin\site\SiteService;
  13. use core\base\BaseAdminService;
  14. /**
  15. * 店铺设置服务层
  16. */
  17. class SettingService extends BaseAdminService
  18. {
  19. /**
  20. * 获取店铺基本信息
  21. * @return array
  22. */
  23. public function getBasicInfo()
  24. {
  25. return (new SiteService())->getInfo($this->site_id);
  26. }
  27. /**
  28. * 修改店铺基本信息
  29. * @param $data
  30. * @return bool
  31. */
  32. public function setBasicInfo($data)
  33. {
  34. return (new SiteService())->edit($this->site_id, $data);
  35. }
  36. /**
  37. * 获取店铺信息
  38. * @return array|null
  39. */
  40. public function getShopInfo() {
  41. $data = [];
  42. $site_info = (new SiteService())->getInfo($this->site_id);
  43. $shop_info = (new ShopAccountService())->getInfo();
  44. $data['site_name'] = $site_info['site_name'];
  45. $data['category_name'] = $shop_info['category_name'];
  46. $data['group_name'] = $site_info['group_name'];
  47. $data['is_self'] = $shop_info['is_self'];
  48. $data['create_time'] = $site_info['create_time'];
  49. $data['expire_time'] = $site_info['expire_time'];
  50. return $data;
  51. }
  52. }