CartController.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\api\controller\pc;
  12. use app\Request;
  13. use app\services\pc\CartServices;
  14. class CartController
  15. {
  16. protected $services;
  17. public function __construct(CartServices $services)
  18. {
  19. $this->services = $services;
  20. }
  21. /**
  22. * 获取用户购物车列表
  23. * @param Request $request
  24. * @return mixed
  25. */
  26. public function getCartList(Request $request)
  27. {
  28. $uid = $request->uid();
  29. $data = $this->services->getCartList((int)$uid);
  30. return app('json')->success($data);
  31. }
  32. }