Esempio n. 1
0
 /**
  * 敏感词删除
  * @date: 2016-1-15 
  * @author: futao
  */
 public function keyworddeleteAction()
 {
     $req = $this->request;
     $keywordId = $req->getQuery('id', null, 0);
     $echo = function ($msg, $state = false) {
         echo '<script type="text/javascript">';
         echo 'parent.formResult("' . $msg . '", ' . ($state ? 1 : 0) . ')';
         echo '</script>';
     };
     if ($keywordId > 0) {
         $keywordModel = CosQKeyword::findFirst($keywordId);
         if ($keywordModel) {
             if ($keywordModel->delete()) {
                 echo "<script>window.parent.location.href='keywordlist'</script>";
             }
         } else {
             $echo("删除失败!");
         }
     } else {
         $echo("删除失败!");
     }
 }