public static function get_instance()
 {
     if (!self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
 public function init()
 {
     //获取动作,action id
     $action = BLL_CmsAreaChange::get_instance()->getNotCompleteAction();
     $this->actionId = $action['id'];
     if (empty($this->actionId)) {
         $this->setLog(sprintf('[%s] remark: %s', date('Y-m-d H:i:s'), '没有可以处理的动作,或获取动作失败'));
         exit;
     }
     //判断执行当前动作list 2 所依赖的list 1是否已经完成
     $referProcessInfo = BLL_CmsAreaChange::get_instance()->getDoListStatus($this->actionId, 1);
     if ($referProcessInfo['status'] != 2) {
         $this->setLog(sprintf('[%s] remark: %s', date('Y-m-d H:i:s'), '租房同步区域板块未完成'));
         exit;
     }
     //获取当前动作list 2
     $processInfo = BLL_CmsAreaChange::get_instance()->getDoListStatus($this->actionId, 2);
     if ($processInfo['status'] == 2) {
         $this->setLog(sprintf('[%s] remark: %s', date('Y-m-d H:i:s'), '当前do list已完成'));
         exit;
     } elseif ($processInfo['status'] == 0) {
         //更新do list列表状态
         BLL_CmsAreaChange::get_instance()->updateDoListStatus(1, "小区信息以及房源更新中", $this->actionId, 2);
     }
     //具体的小区处理
     // 获得参数
     $flag = $this->getFlag();
     if (isset($flag['id']) && is_numeric($flag['id'])) {
         $this->cursor = $flag['id'];
     } else {
         $this->cursor = 0;
     }
 }
 public function init()
 {
     //获取动作,action id
     $action = BLL_CmsAreaChange::get_instance()->getNotCompleteActionByType(4);
     $this->actionId = $action['id'];
     $this->operateId = $action['operator_id'];
     if (empty($this->actionId)) {
         $this->setLog(sprintf('[%s] remark: %s', date('Y-m-d H:i:s'), '没有可以处理的动作,或获取动作失败'));
         exit;
     }
 }
 /**
  * 检查参数
  */
 private function checkParams()
 {
     $this->actionId = $this->getOption('actionid');
     if (!$this->actionId) {
         $action = BLL_CmsAreaChange::get_instance()->getNotCompleteAction();
         if ($action) {
             $this->actionId = $action['id'];
         } else {
             $this->setLog('actionId is empty');
             return false;
         }
     }
     return true;
 }