Comment.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace crmeb\services\erp\storage\jushuitan;
  3. use crmeb\services\erp\AccessToken;
  4. use crmeb\services\erp\storage\Jushuitan;
  5. /**
  6. * 公用接口
  7. * Class Comment
  8. * @package crmeb\services\erp\storage\jushuitan
  9. */
  10. class Comment
  11. {
  12. /**
  13. * token句柄
  14. * @var AccessToken
  15. */
  16. protected $accessToken;
  17. /*** @var Jushuitan */
  18. protected $jushuitan;
  19. /**
  20. * Comment constructor.
  21. * @param AccessToken $accessToken
  22. * @param Jushuitan $jushuitan
  23. */
  24. public function __construct(AccessToken $accessToken, Jushuitan $jushuitan)
  25. {
  26. $this->accessToken = $accessToken;
  27. $this->jushuitan = $jushuitan;
  28. }
  29. /**
  30. * 获取商铺列表
  31. * @param int $page
  32. * @param int $limit
  33. * @return mixed
  34. * @throws \Exception
  35. */
  36. public function getShopList(int $page = 1, int $limit = 10)
  37. {
  38. $api = $this->accessToken->getApiUrl('/open/shops/query');
  39. $biz['items'] = ['page_index' => $page, 'page_size' => $limit];
  40. $params = $this->jushuitan->getParams($biz);
  41. return $this->jushuitan->postRequest($api, $params);
  42. }
  43. }