2026-03-21 02:55:24 +08:00
|
|
|
<?php
|
|
|
|
|
// +----------------------------------------------------------------------
|
2026-03-29 11:22:52 +08:00
|
|
|
// | Author: ScottPan Team
|
2026-03-21 02:55:24 +08:00
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
namespace app\controller\api\pc;
|
|
|
|
|
|
|
|
|
|
use app\Request;
|
|
|
|
|
use app\services\pc\CartServices;
|
|
|
|
|
use think\annotation\Inject;
|
|
|
|
|
use think\Response;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class CartController
|
|
|
|
|
* @author 等风来
|
|
|
|
|
* @email 136327134@qq.com
|
|
|
|
|
* @date 2023/9/19
|
|
|
|
|
* @package app\controller\api\pc
|
|
|
|
|
*/
|
|
|
|
|
class Cart
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @var CartServices
|
|
|
|
|
*/
|
|
|
|
|
#[Inject]
|
|
|
|
|
protected CartServices $services;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取用户购物车列表
|
|
|
|
|
* @param Request $request
|
|
|
|
|
* @return Response
|
|
|
|
|
*/
|
|
|
|
|
public function getCartList(Request $request): Response
|
|
|
|
|
{
|
|
|
|
|
$uid = $request->uid();
|
|
|
|
|
$data = $this->services->getCartList((int)$uid);
|
|
|
|
|
return app('json')->successful($data);
|
|
|
|
|
}
|
|
|
|
|
}
|