/** * @param $id * @return \yii\web\Response */ public function actionDeactivate($id) { if (Searched::updateAll(['status' => Searched::STATUS_INACTIVE], ['id' => $id, 'status' => Searched::STATUS_ACTIVE, 'user_id' => Yii::$app->user->id])) { return $this->redirect('/user/profile'); } else { return $this->goHome(); } }
public function actionTransaction($id) { $result = Yii::$app->request->post(); $json_data = base64_decode($result['data']); $data = json_decode($json_data, true); if ($data) { Transaction::saveTransaction($data, $id); } if ($data['status'] === 'success') { $this->send(); if ($model = Searched::updateAll(['plan_id' => $data['description']], ['id' => $id])) { return $this->redirect('/user/profile'); } else { return $this->goHome(); } } else { return $this->goHome(); } }