/** * Updates an existing Record model. * If update is successful, the browser will be redirected to the 'view' page. * @param string $todaydetail * @param string $st_classmark * @return mixed */ public function actionUpdate($todaydetail, $st_classmark) { $searchModel = new RecordSearch(); $te_id = $searchModel->searchte_id(); $model = $this->findModel($todaydetail, $st_classmark); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['index', 'todaydetail' => $model->todaydetail, 'st_classmark' => $model->st_classmark]); } else { //获取可执行操作的数据 $array = self::getRoleAction($te_id); return $this->render('update', ['model' => $model, 'array' => $array]); } }
/** * Lists all Record models. * @return mixed */ public function actionIndex() { $searchModel = new RecordSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }