public function actionSimpanproses() { //$rodetails = new Rodetail(); $ts = Yii::$app->request->post(); if (count($ts) == 0) { return $this->redirect([' ']); } $kd = $ts['kd']; foreach ($ts['ck'] as $ts) { $rodetail = Rodetail::findOne($ts); $rodetail->STATUS = 1; if ($rodetail->save()) { $reqro = Requestorder::find()->where(['KD_RO' => $kd])->one(); $reqro->STATUS = 1; $reqro->save(); } } return $this->redirect(['proses', 'kd' => $kd]); // $rodetail->save(); }
/** * Finds the Rodetail model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param string $id * @return Rodetail the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Rodetail::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }