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.

50 lines
1.2 KiB

5 years ago
5 years ago
  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 (isset($res['error'])) {
  18. return $this->result(ErrorCode::GOODS_FAILURE, '', $res['error']);
  19. }
  20. return $this->success($res);
  21. }
  22. public function updateShopCar()
  23. {
  24. $res = $this->purchaseLimitService->updateShopCar($this->request->all());
  25. if (isset($res['error'])) {
  26. return $this->result(ErrorCode::GOODS_FAILURE, '', $res['error']);
  27. }
  28. return $this->success($res);
  29. }
  30. public function getStoreIdByMarketId()
  31. {
  32. $res = $this->purchaseLimitService->getStoreIdByMarketId($this->request->all());
  33. return $this->success($res);
  34. }
  35. public function test()
  36. {
  37. $res = $this->purchaseLimitService->test($this->request->all());
  38. return $this->success($res);
  39. }
  40. }