public function actionAdminupdatemoment() { //判断信息是否填写完全 if (empty($_POST["moment_content"]) || !isset($_POST["moment_content"]) || (empty($_POST["momentid"]) || !isset($_POST["momentid"]))) { echo '{"success":false,"msg":"内容填写错误"}'; return; } $aimmoment = Moments::findOne($_POST['momentid']); $aimmoment->Content = \yii\helpers\Html::encode($_POST['moment_content']); $aimmoment->save(false); echo '{"success":true,"msg":"添加成功!"}'; }