コード例 #1
0
ファイル: WeTagsController.php プロジェクト: 3116246/haolinju
 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;
 }
コード例 #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));
 }
コード例 #3
0
ファイル: Staff.php プロジェクト: 3116246/haolinju
 public function getTag()
 {
     $tag = new UserTag($this->conn, $this->logger);
     return $tag->gettag($this->account);
 }
コード例 #4
0
ファイル: UserController.php プロジェクト: 3116246/haolinju
 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;
 }