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.

31 lines
1008 B

5 years ago
5 years ago
5 years ago
5 years ago
  1. <?php
  2. namespace App\Controller\v3;
  3. use App\Controller\BaseController;
  4. use Hyperf\Di\Annotation\Inject;
  5. use App\Service\v3\Interfaces\ShopCartUpdateServiceInterface;
  6. use App\Request\v3\ShopCartUpdateRequest;
  7. class ShopCartUpdateController extends BaseController
  8. {
  9. /**
  10. * @Inject
  11. * @var ShopCartUpdateServiceInterface
  12. */
  13. protected $shopCarServiceUpdate;
  14. public function update(ShopCartUpdateRequest $request)
  15. {
  16. $user_id = $this->request->input('user_id',0);
  17. $goods_id = $this->request->input('goods_id',0);
  18. $num = $this->request->input('num','');
  19. $activity_type = $this->request->input('activity_type',1);
  20. $res = $this->shopCarServiceUpdate->do($user_id,$goods_id,$num,$activity_type);
  21. return $this->success($res);
  22. }
  23. public function delete()
  24. {
  25. $shopcartIds = $this->request->input('shopcart_ids','');
  26. $res = $this->shopCarServiceUpdate->undo($shopcartIds);
  27. return $this->success($res);
  28. }
  29. }