这是我的代码,我遗漏了一些明显的东西,但无法弄清楚:public function actionCheckout() { $model = new User; // $userProfile = UserProfile::find(['user_id'=>$model->id])->One(); $userProfile = new UserProfile; $cartItems = $this->cart->getItems(); if (Yii::$app->request->post()) { $cart = (array_merge(...$_SESSION['primary-cart'])); if($_POST['account-option']=="on"){ // echo "true";exit; $userProfile->first_name = $_POST['User']['first_name']; $userProfile->last_name = $_POST['User']['last_name']; $userProfile->phone = $_POST['User']['phone']; $userProfile->email = $_POST['User']['email']; $userProfile->address1 = $_POST['UserProfile']['address1']; // $userProfile->address2 = $_POST['UserProfile']['address2']; $userProfile->city = $_POST['UserProfile']['city']; $userProfile->state = $_POST['UserProfile']['state']; $userProfile->Country = $_POST['User']['Country']; $userProfile->pincode = $_POST['UserProfile']['pincode']; $userProfile->save(); } $params=[ 'id'=>$cart['productId'], 'amount'=> $cart['price'], 'productinfo' => $cart['title'], 'firstname' => $_POST['User']['first_name'], 'email' => $_POST['User']['email'], 'phone' => $_POST['User']['phone'] ]; Yii::$app->Payu->PayuCheckout($params); } return $this->render('checkout',['model'=>$model,'userProfile' =>$userProfile,'cartItems' => $cartItems]); }我被正确地重定向到 payU,没有任何问题,但是数据没有保存到 userProfile,日志中也没有任何内容。
- 1 回答
- 0 关注
- 183 浏览
添加回答
举报
0/150
提交
取消