Ejemplo n.º 1
0
 public function delUserTagAction()
 {
     $user = $this->get('security.context')->getToken()->getUser();
     $request = $this->getRequest();
     $da = $this->get('we_data_access');
     $tag_id = $request->get('tag_id');
     $s = '1';
     $m = '';
     $usertag = new UserTag($da, $this->get('logger'), $this->container);
     if (!$usertag->deltag($tag_id)) {
         $s = '0';
         $m = '操作失败';
     }
     $response = new Response(json_encode(array('s' => $s, 'm' => $m)));
     $response->headers->set('Content-Type', 'Application/json');
     return $response;
 }
Ejemplo n.º 2
0
 public function UserTagAction()
 {
     $user = $this->get('security.context')->getToken()->getUser();
     $request = $this->getRequest();
     $da = $this->get('we_data_access');
     $usertag = new UserTag($da, $this->get('logger'), $this->container);
     $rows = $usertag->gettag($user->getUserName());
     $have = count($rows);
     return $this->render("JustsyBaseBundle:FriendCircle:usertag.html.twig", array('rows' => $rows, 'count' => $have));
 }
Ejemplo n.º 3
0
 public function getTag()
 {
     $tag = new UserTag($this->conn, $this->logger);
     return $tag->gettag($this->account);
 }
Ejemplo n.º 4
0
 public function getUserTagAction()
 {
     $code = ReturnCode::$SUCCESS;
     $rows = array();
     try {
         $user = $this->get('security.context')->getToken()->getUser();
         $request = $this->getRequest();
         $da = $this->get('we_data_access');
         $account = $request->get('account');
         if (empty($account)) {
             $account = $user->getUserName();
         }
         $login_account = $this->getAccountByKey($da, $account);
         $usertag = new UserTag($da, $this->get('logger'), $this->container);
         $rows = $usertag->gettag($login_account);
     } catch (\Exception $e) {
         $this->get('logger')->err($e);
         $code = ReturnCode::$SYSERROR;
         $rows = array();
     }
     $re = array('returncode' => $code, 'rows' => $rows);
     $response = new Response(json_encode($re));
     $response->headers->set('Content-Type', 'Application/json');
     return $response;
 }