Exemplo n.º 1
0
 public function handle_request()
 {
     $apf = APF::get_instance();
     $request = $apf->get_request();
     $response = $apf->get_response();
     try {
         $key = $request->get_parameter('key');
         $hash = $request->get_parameter('hash');
         $brokerId = $request->get_parameter('broker_id');
         if (!($key && $hash && $brokerId)) {
             throw new Exception_ChristmasException('Parameters incomplete.', self::CODE_PARAMETERS_INCOMPLETE);
         }
         $params = $request->get_parameters();
         unset($params['hash']);
         ksort($params);
         // 按照键值排序(升序)所有参数
         $params['secret'] = self::$account['secret'];
         $query = http_build_query($params);
         if (md5($query) !== $hash) {
             throw new Exception_ChristmasException('Parameters invalid.', self::CODE_PARAMETERS_INVALID);
         }
         // 获取经纪人详情
         self::$BrokerInfo = Bll_BrokerBaseBll::get_instance()->get_broker_info($brokerId);
         $userId = self::$BrokerInfo['BaseInfo'][strtoupper('userId')];
         // 判断经纪人是否通过双证验证
         if (self::$BrokerInfo['BaseInfo'][strtoupper('checkstate')] == 0) {
             throw new Exception_ChristmasException('Check state first.', self::CODE_NOT_CHECK_STATE);
         }
         // 判断今天是否已经送过锤子
         if (Model_Christmas_HammerLog::hammerLogForApp($brokerId, date('Y-m-d'))) {
             throw new Exception_ChristmasException('Already gifted, today.', self::CODE_ALREADY_GIFTED);
         }
         // 经纪人添加锤子
         Model_Christmas_BrokerHammer::incrBrokerHammerForApp($brokerId);
         // 发送系统消息
         $messages = Util_Christmas::messages();
         if (isset($messages[Model_Christmas_HammerLog::TYPE_APP_PUBLISH_HOUSE])) {
             Bll_Service_Message::sendSystem(array('receiverIds' => $userId, 'message' => $messages[Model_Christmas_HammerLog::TYPE_APP_PUBLISH_HOUSE]));
         }
         $result = array('code' => self::CODE_SUCCESS, 'message' => 'Success.');
     } catch (Exception_ChristmasException $e) {
         $result = array('code' => $e->getCode(), 'message' => $e->getMessage());
     } catch (Exception $e) {
         // 500 Error
         // http_response_code('500');
         $result = array('code' => '500', 'message' => 'Server Error.');
     }
     $response->set_content_type('application/json', 'UTF-8');
     $response->add_header('Cache-Control', 'no-cache, no-store, must-revalidate');
     $response->add_header('Pragma', 'no-cache');
     $response->add_header('Expires', 0);
     echo json_encode($result);
     die;
 }
Exemplo n.º 2
0
 public function handle_request()
 {
     $apf = APF::get_instance();
     $request = $apf->get_request();
     $response = $apf->get_response();
     try {
         // 判断经纪人是否已经登陆
         if (!$this->isBrokerLogin()) {
             throw new Exception_ChristmasException('Login first.', self::CODE_NOT_LOGIN);
         }
         // 获取经纪人详情
         self::$BrokerInfo = Bll_BrokerBaseBll::get_instance()->get_broker_info(self::$intBrokerID);
         $brokerId = self::$BrokerInfo['BaseInfo'][strtoupper('brokerid')];
         $userId = self::$BrokerInfo['BaseInfo'][strtoupper('userId')];
         // 判断经纪人是否通过双证验证
         if (self::$BrokerInfo['BaseInfo'][strtoupper('checkstate')] == 0) {
             throw new Exception_ChristmasException('Check state first.', self::CODE_NOT_CHECK_STATE);
         }
         // 判断是否是有效页面
         $type = $request->get_parameter('type');
         if (!Model_Christmas_HammerLog::validatePageType($type)) {
             throw new Exception_ChristmasException('Invalid page type.', self::CODE_INVALID_TYPE);
         }
         // 判断该页面是否已经领过锤子
         if ($hammerLog = Model_Christmas_HammerLog::hammerLogForPage($brokerId, $type)) {
             throw new Exception_ChristmasException('Already sought.', self::CODE_ALREADY_SOUGHT);
         }
         $is_check = $request->get_parameter('is_check');
         if ($is_check != true) {
             // 经纪人添加锤子
             Model_Christmas_BrokerHammer::incrBrokerHammerForPage($brokerId, $type, 1);
             // 发送系统消息
             $messages = Util_Christmas::messages();
             if (isset($messages[$type])) {
                 Bll_Service_Message::sendSystem(array('receiverIds' => $userId, 'message' => $messages[$type]));
             }
         }
         $result = array('code' => self::CODE_SUCCESS, 'message' => 'Success.');
     } catch (Exception_ChristmasException $e) {
         $result = array('code' => $e->getCode(), 'message' => $e->getMessage());
     } catch (Exception $e) {
         // 500 Error
         // http_response_code('500');
         $result = array('code' => '500', 'message' => 'Server Error.');
     }
     $response->set_content_type('application/json', 'UTF-8');
     $response->add_header('Cache-Control', 'no-cache, no-store, must-revalidate');
     $response->add_header('Pragma', 'no-cache');
     $response->add_header('Expires', 0);
     echo json_encode($result);
     die;
 }
Exemplo n.º 3
0
 public function handle_request()
 {
     $apf = APF::get_instance();
     $request = $apf->get_request();
     $response = $apf->get_response();
     try {
         // 判断经纪人是否已经登陆
         if (!$this->isBrokerLogin()) {
             throw new Exception_ChristmasException('Login first.', self::CODE_NOT_LOGIN);
         }
         // 获取经纪人详情
         self::$BrokerInfo = Bll_BrokerBaseBll::get_instance()->get_broker_info(self::$intBrokerID, true);
         $brokerId = self::$BrokerInfo['BaseInfo'][strtoupper('brokerid')];
         $userId = self::$BrokerInfo['BaseInfo'][strtoupper('userId')];
         // 判断经纪人是否通过双证验证
         /*if (self::$BrokerInfo['BaseInfo'][strtoupper('checkstate')] == 0) {
               throw new Exception_ChristmasException('Check state first.', self::CODE_NOT_CHECK_STATE);
           }*/
         // 判断经纪人兑换的锤子是否已经多于3把
         $brokerExchangeHammers = Model_Christmas_HammerLog::data_access()->force_master()->filter('type', Model_Christmas_HammerLog::TYPE_GRADE_EXCHANGE)->filter('brokerId', $brokerId)->count();
         if ($brokerExchangeHammers >= self::EXCHANGE_HAMMER_LIMIT) {
             throw new Exception_ChristmasException('Reach exchange limit.', self::CODE_REACH_EXCHANGE_LIMIT);
         }
         // 判断经纪人的积分是否足否兑换锤子
         $brokerGradeScore = self::$BrokerInfo['BaseInfo'][strtoupper('gradescore')];
         if ($brokerGradeScore < self::EXCHANGE_GRADE_SCORE) {
             throw new Exception_ChristmasException('Grade not enough', self::CODE_GRADE_NOT_ENOUGH);
         }
         // 积分换锤子
         $brokerHammer = Model_Christmas_BrokerHammer::incrBrokerHammerForGrade($brokerId, 1);
         // 发送系统消息
         $messages = Util_Christmas::messages();
         if (isset($messages[Model_Christmas_HammerLog::TYPE_GRADE_EXCHANGE])) {
             Bll_Service_Message::sendSystem(array('receiverIds' => $userId, 'message' => $messages[Model_Christmas_HammerLog::TYPE_GRADE_EXCHANGE]));
         }
         // 添加积分消费记录
         $gradeLog = new Model_Grade_Log(date('Ym'));
         $gradeLog->itemId = self::GRADE_ITEM;
         $gradeLog->operateType = 1;
         $gradeLog->time = time();
         $gradeLog->date = date('Ymd', $gradeLog->time);
         $gradeLog->data = serialize(array('time' => date('Y年m月d日 H时i分s秒')));
         $gradeLog->score = 300;
         $gradeLog->brokerId = $brokerId;
         $gradeLog->adminId = 0;
         $gradeLog->flag = 0;
         // 未处理
         $gradeLog->appId = 1;
         // 经纪人
         $gradeLog->save();
         $brokerGradeScore -= self::EXCHANGE_GRADE_SCORE;
         $result = array('code' => self::CODE_SUCCESS, 'message' => 'Success.', 'coin' => $brokerGradeScore, 'number' => $brokerHammer->number);
     } catch (Exception_ChristmasException $e) {
         $result = array('code' => $e->getCode(), 'message' => $e->getMessage(), 'isLogin' => intval($this->isBrokerLogin()), 'loginUrl' => Uri_ChristmasUrl::login_url(Uri_ChristmasUrl::hammer_url()));
     } catch (Exception $e) {
         // 500 Error
         // http_response_code('500');
         $result = array('code' => '500', 'message' => 'Server Error.');
     }
     $response->set_content_type('application/json', 'UTF-8');
     $response->add_header('Cache-Control', 'no-cache, no-store, must-revalidate');
     $response->add_header('Pragma', 'no-cache');
     $response->add_header('Expires', 0);
     echo json_encode($result);
     die;
 }
Exemplo n.º 4
0
 /**
  * 执行获奖
  * @param $prize_type
  * return
  */
 function do_win_prize($prize_type)
 {
     //先插入获奖日志
     $prize_log_obj = $this->write_prize_log($prize_type, self::$intBrokerID, self::$BrokerInfo['TRUENAME'], self::$BrokerInfo['USERMOBILE'], self::$BrokerInfo['CITYID']);
     //获取获奖总数量
     $cur_prize_num = Model_Christmas_PrizeLog::get_win_prize_num($prize_type, '', $prize_log_obj->id);
     //获取当前能够得到的奖品上限
     $provide_prize_num = $this->get_provide_prize_num($prize_type);
     //再取出判断是否超过奖品数量上限
     if ($cur_prize_num <= $provide_prize_num) {
         //发送获奖信息
         $this->send_msg($prize_type);
         //如果中奖的是再来一把锤子则给经纪人加锤子
         if ($prize_type == 8) {
             //加锤子
             Model_Christmas_BrokerHammer::incrBrokerHammerNumber(self::$intBrokerID, 1);
             //写使用锤子日志
             $this->write_hammer_log(self::$intBrokerID, 1, '砸蛋奖锤子');
         }
         $PRIZE_N_STATUS = "PRIZE_{$prize_type}_STATUS";
         $PRIZE_N_INFO = "PRIZE_{$prize_type}_INFO";
         echo json_encode(array("success" => true, "status" => self::${$PRIZE_N_STATUS}, "info" => self::${$PRIZE_N_INFO}));
         exit;
     } else {
         //如果超出上限,则删除
         $prize_log_obj->delete();
         echo json_encode(array("success" => true, "status" => self::$NO_PRIZE_STATUS));
         exit;
     }
 }
Exemplo n.º 5
0
 /**
  * 逻辑
  * 插入前,判断 排名 < 1000,执行插入。
  * 插入后,判断 排名 < 1000,更新总数;否则,删除。
  */
 public function handle_request()
 {
     $apf = APF::get_instance();
     $request = $apf->get_request();
     $response = $apf->get_response();
     $cache = APF_Cache_Factory::get_instance()->get_memcache();
     // CurrentRoundTime & NextRoundTime
     $currentRoundTime = null;
     $nextRoundTime = null;
     $startDate = Util_Christmas::hammerRushStartDate();
     $endDate = Util_Christmas::hammerRushEndDate();
     if (!Util_Christmas::hammerRushStarted()) {
         $currentRoundTime = null;
         $nextRoundTime = date("{$startDate} 10:00:00");
     } elseif (!Util_Christmas::hammerRushEnded()) {
         $currentHour = date('H');
         if ($currentHour < 10) {
             if (date('Y-m-d') != $startDate) {
                 $currentRoundTime = date('Y-m-d 18:00:00', strtotime('-1 day'));
             }
             $nextRoundTime = date('Y-m-d 10:00:00');
         } elseif ($currentHour >= 10 && $currentHour < 14) {
             $currentRoundTime = date('Y-m-d 10:00:00');
             $nextRoundTime = date('Y-m-d 14:00:00');
         } elseif ($currentHour >= 14 && $currentHour < 18) {
             $currentRoundTime = date('Y-m-d 14:00:00');
             $nextRoundTime = date('Y-m-d 18:00:00');
         } elseif ($currentHour >= 18) {
             $currentRoundTime = date('Y-m-d 18:00:00');
             if (date('Y-m-d') != $endDate) {
                 $nextRoundTime = date('Y-m-d 10:00:00', strtotime('+1 day'));
             }
         }
     }
     // IsRushable
     $isRushable = false;
     // 当前在可抢时间范围内
     if ($currentRoundTime && time() < strtotime($currentRoundTime) + 30 * 60) {
         $isRushable = true;
     }
     // 当前可抢开关
     $result = $cache->get(Util_Christmas::hammerIsRushableCacheKey($currentRoundTime));
     if ($result !== FALSE) {
         $isRushable = (bool) $result;
     }
     try {
         // Not Rushable
         if (!$isRushable) {
             throw new Exception_ChristmasException('Not rushable.', self::CODE_FAILED);
         }
         // 判断活动是否已开始
         if (!Util_Christmas::hammerRushStarted()) {
             throw new Exception_ChristmasException('Hammer rush is not started.', self::CODE_NOT_START);
         }
         // 判断活动是否已结束
         if (Util_Christmas::hammerRushEnded()) {
             throw new Exception_ChristmasException('Hammer rush is ended.', self::CODE_ENDED);
         }
         // 判断经纪人是否已经登陆
         if (!$this->isBrokerLogin()) {
             throw new Exception_ChristmasException('Login first.', self::CODE_NOT_LOGIN);
         }
         // 获取经纪人详情
         self::$BrokerInfo = Bll_BrokerBaseBll::get_instance()->get_broker_info(self::$intBrokerID);
         $brokerId = self::$BrokerInfo['BaseInfo'][strtoupper('brokerid')];
         $userId = self::$BrokerInfo['BaseInfo'][strtoupper('userId')];
         // 判断经纪人是否通过双证验证
         if (self::$BrokerInfo['BaseInfo'][strtoupper('checkstate')] == 0) {
             throw new Exception_ChristmasException('Check state first.', self::CODE_NOT_CHECK_STATE);
         }
         // 插入前,判断是否本轮是否已经抢过
         try {
             $hammerLog = Model_Christmas_HammerLog::data_access()->force_master()->filter_by_op('brokerId', '=', $brokerId)->filter_by_op('type', '=', Model_Christmas_HammerLog::TYPE_HAMMER_RUSH)->filter_by_op('createdAt', '>=', $currentRoundTime)->find_one();
         } catch (Exception $e) {
             $hammerLog = false;
         }
         if ($hammerLog) {
             throw new Exception_ChristmasException('Already rushed.', self::CODE_RUSHED);
         }
         // 经纪人添加1把锤子
         $hammerLog = new Model_Christmas_HammerLog();
         $hammerLog->brokerId = $brokerId;
         $hammerLog->type = Model_Christmas_HammerLog::TYPE_HAMMER_RUSH;
         $hammerLog->number = 1;
         $hammerLog->memo = '整点抢锤子';
         $hammerLog->createdAt = date('Y-m-d H:i:s');
         $hammerLog->updatedAt = $hammerLog->createdAt;
         $hammerLog->save();
         // 本轮有效锤子数
         $hammerRoundNumber = 1000;
         // 插入后,判断 排名 < 1000,更新总数;否则,删除。
         $rank = $this->current_round_rank($hammerLog->id, $currentRoundTime);
         if ($rank >= $hammerRoundNumber) {
             $hammerLog->delete();
             $isRushable = false;
             $cache->set(Util_Christmas::hammerIsRushableCacheKey($currentRoundTime), false);
             throw new Exception_ChristmasException('Not rushed.', self::CODE_FAILED);
         }
         // 更新经纪人总锤子
         $brokerHammer = Model_Christmas_BrokerHammer::incrBrokerHammerNumber($brokerId, 1);
         // 发送系统消息
         $messages = Util_Christmas::messages();
         if (isset($messages[Model_Christmas_HammerLog::TYPE_HAMMER_RUSH])) {
             Bll_Service_Message::sendSystem(array('receiverIds' => $userId, 'message' => $messages[Model_Christmas_HammerLog::TYPE_HAMMER_RUSH]));
         }
         $result = array('code' => self::CODE_SUCCESS, 'message' => 'Success.', 'number' => $brokerHammer->number, 'currentTime' => strtotime($currentRoundTime) * 1000, 'nextTime' => $isRushable ? strtotime($currentRoundTime) * 1000 : strtotime($nextRoundTime) * 1000, 'isRushable' => intval($isRushable));
     } catch (Exception_ChristmasException $e) {
         $result = array('code' => $e->getCode(), 'message' => $e->getMessage(), 'nextTime' => $isRushable ? strtotime($currentRoundTime) * 1000 : strtotime($nextRoundTime) * 1000, 'isRushable' => intval($isRushable), 'isLogin' => intval($this->isBrokerLogin()), 'loginUrl' => Uri_ChristmasUrl::login_url(Uri_ChristmasUrl::hammer_url()));
     } catch (Exception $e) {
         // 500 Error
         // http_response_code('500');
         $result = array('code' => '500', 'message' => 'Server Error.');
     }
     $response->set_content_type('application/json', 'UTF-8');
     $response->add_header('Cache-Control', 'no-cache, no-store, must-revalidate');
     $response->add_header('Pragma', 'no-cache');
     $response->add_header('Expires', 0);
     echo json_encode($result);
     die;
 }
Exemplo n.º 6
0
 public function handle_request()
 {
     $is_christmas_test = APF::get_instance()->get_config('is_christmas_test', 'christmas');
     if (!$is_christmas_test) {
         if (time() < strtotime("2013-12-16 00:00:00")) {
             APF::get_instance()->get_response()->redirect(Uri_ChristmasUrl::advance_url());
         }
     }
     $isLoggedIn = $this->isBrokerLogin();
     $this->setAttribute('BrokerIsLoggedIn', $isLoggedIn);
     // 获取缓存实例
     $cache = APF_Cache_Factory::get_instance()->get_memcache();
     // CurrentRoundTime & NextRoundTime
     $currentRoundTime = null;
     $nextRoundTime = null;
     $startDate = Util_Christmas::hammerRushStartDate();
     $endDate = Util_Christmas::hammerRushEndDate();
     if (!Util_Christmas::hammerRushStarted()) {
         $currentRoundTime = null;
         $nextRoundTime = date("{$startDate} 10:00:00");
     } elseif (!Util_Christmas::hammerRushEnded()) {
         $currentHour = date('H');
         if ($currentHour < 10) {
             if (date('Y-m-d') != $startDate) {
                 $currentRoundTime = date('Y-m-d 18:00:00', strtotime('-1 day'));
             }
             $nextRoundTime = date('Y-m-d 10:00:00');
         } elseif ($currentHour >= 10 && $currentHour < 14) {
             $currentRoundTime = date('Y-m-d 10:00:00');
             $nextRoundTime = date('Y-m-d 14:00:00');
         } elseif ($currentHour >= 14 && $currentHour < 18) {
             $currentRoundTime = date('Y-m-d 14:00:00');
             $nextRoundTime = date('Y-m-d 18:00:00');
         } elseif ($currentHour >= 18) {
             $currentRoundTime = date('Y-m-d 18:00:00');
             if (date('Y-m-d') != $endDate) {
                 $nextRoundTime = date('Y-m-d 10:00:00', strtotime('+1 day'));
             }
         }
     }
     $this->setAttribute('CurrentRoundTime', $currentRoundTime);
     $this->setAttribute('NextRoundTime', $nextRoundTime);
     // IsRushable
     $isRushable = false;
     // 当前在可抢时间范围内
     if ($currentRoundTime && time() < strtotime($currentRoundTime) + 30 * 60) {
         $isRushable = true;
     }
     // 当前可抢开关
     $result = $cache->get(Util_Christmas::hammerIsRushableCacheKey($currentRoundTime));
     if ($result !== FALSE) {
         $isRushable = (bool) $result;
     }
     $this->setAttribute('IsRushable', $isRushable);
     $this->setAttribute('IsEnd', Util_Christmas::hammerRushEnded());
     if ($isLoggedIn) {
         $brokerId = self::$intBrokerID;
         self::$BrokerInfo = Bll_BrokerBaseBll::get_instance()->get_broker_info($brokerId, true);
         $this->setAttribute('BrokerName', $this->request->getUserName());
         $isCheckedState = isset(self::$BrokerInfo['BaseInfo'][strtoupper('checkstate')]) && self::$BrokerInfo['BaseInfo'][strtoupper('checkstate')];
         $this->setAttribute('BrokerIsCheckedState', $isCheckedState);
         $gradeScore = isset(self::$BrokerInfo['BaseInfo'][strtoupper('gradescore')]) ? self::$BrokerInfo['BaseInfo'][strtoupper('gradescore')] : 0;
         $this->setAttribute('BrokerGradeScore', $gradeScore);
         $exchangeHammerNumber = Model_Christmas_HammerLog::data_access()->filter_by_op('brokerId', '=', $brokerId)->filter_by_op('type', '=', Model_Christmas_HammerLog::TYPE_GRADE_EXCHANGE)->count();
         $isExchangeable = $exchangeHammerNumber < 3;
         $this->setAttribute('IsExchangeAble', $isExchangeable);
         $brokerHammer = Model_Christmas_BrokerHammer::fetchBrokerHammerByBrokerId($brokerId, true);
         $this->setAttribute('BrokerHammerNumber', $brokerHammer->number);
     } else {
         $this->setAttribute('BrokerLoginUrl', Uri_ChristmasUrl::login_url($this->request->get_request_url()));
     }
     return 'Christmas_Hammer';
 }
Exemplo n.º 7
0
 /**
  * 积分换锤子
  *
  * @param $brokerId
  * @param $number
  *
  * @return Model_Christmas_BrokerHammer
  */
 public static function incrBrokerHammerForGrade($brokerId, $number = 1)
 {
     // 创建锤子日志
     $hammerLog = new Model_Christmas_HammerLog();
     $hammerLog->brokerId = $brokerId;
     $hammerLog->type = Model_Christmas_HammerLog::TYPE_GRADE_EXCHANGE;
     $hammerLog->number = $number;
     $hammerLog->memo = '积分换锤子';
     $hammerLog->createdAt = date('Y-m-d H:i:s');
     $hammerLog->updatedAt = $hammerLog->createdAt;
     $hammerLog->save();
     // 更新锤子总数
     $brokerHammer = Model_Christmas_BrokerHammer::incrBrokerHammerNumber($brokerId, $number);
     return $brokerHammer;
 }
Exemplo n.º 8
0
 public function handle_request()
 {
     $objRequest = APF::get_instance()->get_request();
     //时间开关
     $is_christmas_test = APF::get_instance()->get_config('is_christmas_test', 'christmas');
     if (!$is_christmas_test) {
         if (time() < strtotime("2013-12-16 00:00:00")) {
             APF::get_instance()->get_response()->redirect(Uri_ChristmasUrl::advance_url());
         }
         self::$intBrokerID = $objRequest->getBrokerId();
     } else {
         self::$intBrokerID = $objRequest->getBrokerId();
     }
     $bllBrokerHome = Bll_BrokerHomeBll::get_instance();
     $BrokerName = $bllBrokerHome->get_broker_name();
     //获取经纪人和锤子信息
     $broker_hammer_obj = Model_Christmas_BrokerHammer::fetchBrokerHammerByBrokerId(self::$intBrokerID);
     //获取城市配置
     $city_config = APF::get_instance()->get_config('cities', 'multicity');
     //获取获奖信息
     $win_prize_obj = Model_Christmas_PrizeLog::get_win_prize_info();
     $win_prize_info = array();
     foreach ($win_prize_obj as $win_prize) {
         if ($win_prize->type >= 8) {
             continue;
         }
         $prize_name = $this->get_prize_name($win_prize->type);
         $broker_name = mb_substr($win_prize->broker_name, 0, 1, 'utf8') . "XX";
         $mobile = substr($win_prize->mobile, 0, 3) . "****" . substr($win_prize->mobile, -4);
         $type = $win_prize->type <= 3 ? 1 : 0;
         $win_prize_info[] = array("name" => $broker_name, "tel" => $mobile . "(" . $city_config[$win_prize->city_id] . ")", "prize" => $prize_name, "type" => $type);
     }
     //是否登陆
     if (self::$intBrokerID) {
         $this->setAttribute('is_login', true);
     } else {
         $this->setAttribute('is_login', false);
     }
     //判断是不是活动时间
     if (date("Ymd") == '20131225' || $is_christmas_test) {
         $this->setAttribute('is_begin', true);
     } else {
         $this->setAttribute('is_begin', false);
     }
     $this->setAttribute('BrokerName', $BrokerName);
     $this->setAttribute('broker_hammer_num', $broker_hammer_obj->number ? $broker_hammer_obj->number : 0);
     $this->setAttribute('win_prize_info', json_encode($win_prize_info));
     $this->setAttribute('broker_id', self::$intBrokerID);
     if (time() > strtotime("2013-12-25 00:00:00") || $is_christmas_test) {
         //正是砸蛋的逻辑
         //....
         $pageName = "Christmas_GoldenEgg";
     } else {
         //砸蛋预告页
         $pageName = "Christmas_GoldenEggAdvance";
     }
     /*
      * 前端开发暂用
      */
     return $pageName;
 }