You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
671 B

  1. <?php
  2. namespace App\Controller\v3;
  3. use App\Controller\BaseController;
  4. use Hyperf\Di\Annotation\Inject;
  5. use App\Service\v3\Interfaces\ShopCartServiceInterface;
  6. class ShopCartController extends BaseController
  7. {
  8. /**
  9. * @Inject
  10. * @var ShopCartServiceInterface
  11. */
  12. protected $shopCartService;
  13. public function detail()
  14. {
  15. //获取购物车商品信息
  16. $res['store_lists'] = $this->shopCartService->do();
  17. //获取购物车失效商品信息
  18. $res['store_lists_invalid'] = $this->shopCartService->undo();
  19. //计算购物车价格
  20. $res['total'] = '820.00';
  21. return $this->success($res);
  22. }
  23. }