Exemplo n.º 1
0
 public function ajaxHideAction()
 {
     $globalId = (int) Request::getPOST('global-id');
     $problemInfo = OjProblemInterface::getById(array('id' => $globalId));
     if (empty($problemInfo)) {
         $this->renderError('题目不存在!');
     }
     if ($problemInfo['hidden']) {
         $this->renderError('题目已经隐藏!');
     }
     OjProblemInterface::hide(array('id' => $globalId));
     $this->setNotice(FrameworkVars::NOTICE_SUCCESS, '隐藏成功!');
     $this->renderAjax(0);
 }