public function attenUserAction() { $code = ReturnCode::$SUCCESS; $msg = ''; try { $user = $this->get('security.context')->getToken()->getUser(); $request = $this->getRequest(); $login_account = $request->get('atten_account'); $da = $this->get('we_data_access'); $da_im = $this->get('we_data_access_im'); $staff = new Staff($da, $da_im, $user->getUserName()); $staff->attentionTo($login_account); } catch (\Exception $e) { $this->get('logger')->err($e); $msg = '系统错误'; $code = ReturnCode::$SYSERROR; } $re = array('returncode' => $code, 'msg' => $msg); $response = new Response(json_encode($re)); $response->headers->set('Content-Type', 'Application/json'); return $response; }