/** 修改状态 */ public function actionChangeState() { $request = Yii::$app->request; if ($request->isPost) { $infoId = $request->post('infoId'); $state = $request->post('state'); if ($state == 'ok') { if ($result = Info::changeState($infoId, Info::STATE_PASS)) { return $result; } } elseif ($state == 'error') { $replyContent = $request->post('replyContent'); if ($result = Info::changeState($infoId, Info::STATE_REFUSE, $replyContent)) { return $result; } } else { return "状态未定义"; } return 'ok'; } else { throw new Exception("非正常请求"); } }