- 按 docs/renew-code-comment.md 将 PHP 文件头改为带边框的 Author 注释\n- 注释中的 crmeb.com 替换为 uj345.cn(代码字符串中的外链未改)\n- 新增 docs/renew-code-comment.md 说明 Made-with: Cursor
40 lines
876 B
PHP
40 lines
876 B
PHP
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Author: ScottPan Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
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);
|
|
}
|
|
}
|