コード例 #1
0
 public function convHideAction()
 {
     $request = $this->getRequest();
     $user = $this->get('security.context')->getToken()->getUser();
     $oper = $request->get("oper");
     $conv_id = $request->get("conv_id");
     $conv = new \Justsy\BaseBundle\Business\Conv();
     $da = $this->get('we_data_access');
     $s = '1';
     $m = '';
     if ($oper == 'true') {
         if (!$conv->convHide($da, $conv_id, $user->getUserName())) {
             $s = '0';
             $m = '操作失败';
         }
     } else {
         if ($oper == 'false') {
             if (!$conv->convCancelHide($da, $conv_id, $user->getUserName())) {
                 $s = '0';
                 $m = '操作失败';
             }
         }
     }
     $response = new Response(json_encode(array('s' => $s, 'm' => $m)));
     $response->headers->set('Content-Type', 'text/json');
     return $response;
 }