public function handle_request()
 {
     $this->cursor = self::STARTCURSOR;
     $cursorInfo = $this->getFlag();
     if (empty($cursorInfo)) {
         $cursorInfo['id'] = self::STARTCURSOR;
     }
     $this->cursor = $cursorInfo['id'];
     $data = $this->getData();
     if (empty($data)) {
         $this->setStop();
         return false;
     }
     foreach ($data as $k => $v) {
         $cursorInfo['id'] = $v['id'];
         $this->setFlag($cursorInfo);
         //插入分表中
         $status = Model_Mobile_DailyReplyLessThirty::insertNewData($v);
         if (!$status) {
             return false;
         }
         //推送信息
         if (!$this->push($v['brokerId'])) {
             return false;
         }
         //赠送抢客劵
         if (!Bll_Mobile_DailyQuest::presentExtraQuestCoupon($v['brokerId'])) {
             return false;
         }
         //更新赠送状态
         Model_Mobile_DailyReplyLessThirty::updatePresentStatus($v['brokerId']);
     }
     return true;
 }
Esempio n. 2
0
 public static function get_instance()
 {
     if (!self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }