コード例 #1
0
 public function getActivityDetail()
 {
     $token = session('token');
     $activityId = $_POST['activityId'];
     $flashId = intval($_POST['flashId']);
     if (empty($token) || empty($activityId)) {
         $this->ajaxReturn(array(), 'JSON');
     }
     $details = array();
     switch ($activityId) {
         case 'dingdan':
             $details = LinkHelper::getOrders($token);
             break;
         case 'dazhuanpan':
             $details = LinkHelper::getLotteryList($token, 1);
             break;
         case 'guaguaka':
             $details = LinkHelper::getLotteryList($token, 2);
             break;
         case 'youhuiquan':
             $details = LinkHelper::getLotteryList($token, 3);
             break;
         case 'toupiao':
             $details = LinkHelper::getVoteList($token);
             break;
         case 'hotel':
             $details = LinkHelper::getHotels($token);
             break;
         case 'pinglun':
             $details = LinkHelper::getReplyList($token);
             break;
         case 'yingxiang':
             $details = LinkHelper::getImpressList($token);
             break;
         default:
             break;
     }
     // load flash information
     $selectedId = '';
     if (!empty($flashId)) {
         $where['id'] = $flashId;
         $where['token'] = session('token');
         $info = M('Flash')->where($where)->find();
         if ($info) {
             if ($info['link_param_l1'] == $activityId) {
                 $selectedId = $info['link_param_l2'];
             }
         }
     }
     $res = array();
     $res['details'] = $details;
     $res['selected'] = $selectedId;
     $this->ajaxReturn($res, 'JSON');
 }