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.

29 lines
627 B

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Controller;
  4. use Hyperf\Di\Annotation\Inject;
  5. use App\Service\PurchaseLimitServiceInterface;
  6. use App\Constants\ErrorCode;
  7. class PurchaseLimitController extends BaseController
  8. {
  9. /**
  10. * @Inject
  11. * @var PurchaseLimitServiceInterface
  12. */
  13. protected $purchaseLimitService;
  14. public function addShopCar()
  15. {
  16. $res = $this->purchaseLimitService->addShopCar($this->request->all());
  17. if (!$res) {
  18. return $this->result(ErrorCode::GOODS_FAILURE, '', '商品已超过购买数量');
  19. }
  20. return $this->success($res);
  21. }
  22. }