public function down()
 {
     $this->dropTable($this->tableName);
     $this->addColumn(Orders::tableName(), 'quantity', $this->integer(5)->notNull()->defaultValue(0));
     $this->addColumn(Orders::tableName(), 'product_id', $this->integer(5)->notNull());
     $this->addColumn(Orders::tableName(), 'type', $this->string(255)->notNull());
 }
Exemplo n.º 2
0
 public function actionConfirm()
 {
     $user_id = Yii::$app->user->identity->id;
     Yii::$app->db->createCommand()->update(Orders::tableName(), ['confirm' => 1], ['user_id' => $user_id, 'confirm' => 0])->execute();
     //подтверждаем заказ в корзине
     Yii::$app->controller->redirect('wait');
 }