Site.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. /**
  3. * Index.php
  4. * Niushop商城系统 - 团队十年电商经验汇集巨献!
  5. * =========================================================
  6. * Copy right 2015-2025 杭州牛之云科技有限公司, 保留所有权利。
  7. * ----------------------------------------------
  8. * 官方网址: https://www.niushop.com
  9. * =========================================================
  10. * @author : niuteam
  11. * @date : 2022.8.8
  12. * @version : v5.0.0.1
  13. */
  14. namespace app\api\controller;
  15. use app\model\system\Site as SiteModel;
  16. use app\model\shop\Shop as ShopModel;
  17. /**
  18. * 店铺
  19. * @author Administrator
  20. *
  21. */
  22. class Site extends BaseApi
  23. {
  24. public function __construct()
  25. {
  26. parent::__construct();
  27. $this->initStoreData();
  28. }
  29. /**
  30. * 基础信息
  31. */
  32. public function info()
  33. {
  34. $field = 'site_id,site_domain,site_name,logo,seo_title,seo_keywords,seo_description,site_tel,logo_square';
  35. $website_model = new SiteModel();
  36. $info = $website_model->getSiteInfo([ [ 'site_id', '=', $this->site_id ] ], $field);
  37. //店铺状态
  38. $shop_model = new ShopModel();
  39. $shop_status_result = $shop_model->getShopStatus($this->site_id, $this->app_module);
  40. $shop_status = $shop_status_result[ 'data' ][ 'value' ];
  41. $info[ 'data' ][ 'shop_status' ] = $shop_status[ 'shop_pc_status' ];
  42. return $this->response($info);
  43. }
  44. /**
  45. * 手机端二维码
  46. * @return false|string
  47. */
  48. public function wapQrcode()
  49. {
  50. $shop_model = new ShopModel();
  51. $res = $shop_model->qrcode($this->site_id);
  52. return $this->response($res);
  53. }
  54. /**
  55. * 是否显示店铺相关功能,用于审核小程序
  56. */
  57. public function isShow()
  58. {
  59. $res = 1;// 0 隐藏,1 显示
  60. return $this->response($this->success($res));
  61. }
  62. /**
  63. * 店铺状态
  64. * @return false|string
  65. */
  66. public function status()
  67. {
  68. return $this->response($this->success());
  69. }
  70. /**
  71. * 店铺联系方式
  72. * @return false|string
  73. */
  74. public function shopContact()
  75. {
  76. $data = ( new ShopModel() )->getShopInfo([ [ 'site_id', '=', $this->site_id ] ], 'mobile');
  77. return $this->response($data);
  78. }
  79. }