Ejemplo n.º 1
0
 public function actionAddQty()
 {
     $id = Yii::$app->request->get('id');
     $qty = Yii::$app->request->get('qty');
     $qty = !$qty ? 1 : $qty;
     $reservationinfo = Reservationinfo::find()->select('reservationinfo.*')->leftJoin('objreservation', 'reservationinfo.objreservation_id = objreservation.id')->where(['=', 'reservationinfo.id', $id])->one();
     $session = Yii::$app->session;
     $session->open();
     $card = new Cart();
     $card->addQty($reservationinfo, $qty);
     $this->view->title = 'Корзина';
     $model = new Orders();
     return $this->render('view', compact('session', 'model'));
 }
Ejemplo n.º 2
0
 public function actionItem($id = null)
 {
     $model = Reservationinfo::find()->select('reservationinfo.*')->leftJoin('objreservation', 'reservationinfo.objreservation_id = objreservation.id')->where(['=', 'reservationinfo.id', $id])->one();
     return $this->render('item', ['model' => $model]);
 }