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.
 
 

32 lines
1008 B

<?php
namespace App\Controller\v3;
use App\Controller\BaseController;
use Hyperf\Di\Annotation\Inject;
use App\Service\v3\Interfaces\ShopCartUpdateServiceInterface;
use App\Request\v3\ShopCartUpdateRequest;
class ShopCartUpdateController extends BaseController
{
/**
* @Inject
* @var ShopCartUpdateServiceInterface
*/
protected $shopCarServiceUpdate;
public function update(ShopCartUpdateRequest $request)
{
$user_id = $this->request->input('user_id',0);
$goods_id = $this->request->input('goods_id',0);
$num = $this->request->input('num','');
$activity_type = $this->request->input('activity_type',1);
$res = $this->shopCarServiceUpdate->do($user_id,$goods_id,$num,$activity_type);
return $this->success($res);
}
public function delete()
{
$shopcartIds = $this->request->input('shopcart_ids','');
$res = $this->shopCarServiceUpdate->undo($shopcartIds);
return $this->success($res);
}
}