/**
  * @param $proId
  * @param $cityId
  * @param string $created
  * @return int
  */
 public static function addQueue($proId, $cityId, $created = '')
 {
     if (!$proId || !$cityId) {
         return false;
     }
     if (!$created) {
         $created = time();
     }
     $obj = new Model_House_HzHouseExpiredQueue();
     $data = array('proId' => $proId, 'cityId' => $cityId, 'created' => $created, 'flag' => 0, 'updated' => time());
     foreach ($data as $key => $value) {
         $obj->{$key} = $value;
     }
     return $obj->save();
 }
Пример #2
0
 public function dealTask($task)
 {
     // 如果有,重新置flag=0 重新下房子
     if (Model_House_HzHouseExpiredQueue::updateQueue($task['proid'], $task['created'])) {
         printf('房源 %s 成功更新过期队列表' . PHP_EOL, $task['proid']);
         return true;
     }
     // 插入过期队列
     if (Model_House_HzHouseExpiredQueue::addQueue($task['proid'], $task['cityid'], $task['created'])) {
         printf('房源 %s 成功插入到过期队列表' . PHP_EOL, $task['proid']);
     } else {
         printf('房源 %s 没有成功插入到过期队列表' . PHP_EOL, $task['proid']);
     }
     return true;
 }