// +---------------------------------------------------------------------- namespace app\controller\api\pc; use app\Request; use app\services\pc\CartServices; class Cart { protected $services; public function __construct(CartServices $services) { $this->services = $services; } /** * 获取用户购物车列表 * @param Request $request * @return mixed */ public function getCartList(Request $request) { $uid = $request->uid(); $data = $this->services->getCartList((int)$uid); return app('json')->successful($data); } }