request->get(); $userId = isset($get['userId']) ? $get['userId'] : 0; $user = xhUserService::getById($userId); if($user['merchantId'] != $this->merchantId){ util::stop('非法访问'); } $cart = xhCartService::getUserCartList($userId); return $this->render('user', ['cart' => $cart,'user' => $user]); } /** * 购物车的里每个商品明细 */ public function actionDetail() { $get = Yii::$app->request->get(); $userId = isset($get['userId']) ? $get['userId'] : 0; $goodsId = isset($get['goodsId']) ? $get['goodsId'] : 0; $user = xhUserService::getById($userId); if($user['merchantId'] != $this->merchantId){ util::stop('非法访问'); } $cart = xhCartService::getByIds($goodsId, $userId); $goods = xhGoodsService::getById($goodsId); return $this->render('detail',['cart' => $cart,'goods' => $goods]); } }