Shop.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-mall 企业快速开发的多应用管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\api\controller\shop;
  12. use app\service\api\shop\ShopMemberService;
  13. use app\service\api\shop\ShopService;
  14. use core\base\BaseApiController;
  15. use think\Response;
  16. class Shop extends BaseApiController
  17. {
  18. /**
  19. * 店铺列表
  20. * @return Response
  21. */
  22. public function lists()
  23. {
  24. $data = $this->request->params([
  25. ['keyword', ''],
  26. ['group_id', ''],
  27. ['category_id', ''],
  28. ['is_self', ''],
  29. ]);
  30. return success((new ShopService())->getPage($data));
  31. }
  32. /**
  33. * 店铺列表
  34. * @return Response
  35. */
  36. public function all()
  37. {
  38. $data = $this->request->params([
  39. ['limit', 0],
  40. ]);
  41. return success((new ShopService())->getAll($data['limit']));
  42. }
  43. /**
  44. * 店铺详情
  45. * @param int $id
  46. * @return Response
  47. */
  48. public function info($id)
  49. {
  50. return success((new ShopService())->getInfo($id));
  51. }
  52. /**
  53. * 店铺关注
  54. * @return Response
  55. */
  56. public function follow($id, $is_follow)
  57. {
  58. (new ShopMemberService())->follow($id, $is_follow);
  59. return success('SUCCESS');
  60. }
  61. }