diff --git a/application/third_party/tripadvisor_spider/controllers/index.php b/application/third_party/tripadvisor_spider/controllers/index.php index a33ec760..55a5a134 100644 --- a/application/third_party/tripadvisor_spider/controllers/index.php +++ b/application/third_party/tripadvisor_spider/controllers/index.php @@ -34,6 +34,8 @@ class Index extends CI_Controller { if ($key_city == $city) { foreach ($page_mark as $page_num) { $page_url = str_replace('{PAGENUM}', $page_num, $item_url); + //使用代理来请求,国内直接访问会很慢 + $page_url=str_replace('https://www.tripadvisor.com', 'http://47.91.16.199:5052', $page_url); $content = GET_HTTP($page_url); if (!empty($content)) { $html_object = str_get_html($content); diff --git a/application/third_party/tripadvisor_spider/models/Tripadvisor_Review_model.php b/application/third_party/tripadvisor_spider/models/Tripadvisor_Review_model.php index f9830724..02ffed1f 100644 --- a/application/third_party/tripadvisor_spider/models/Tripadvisor_Review_model.php +++ b/application/third_party/tripadvisor_spider/models/Tripadvisor_Review_model.php @@ -17,7 +17,7 @@ class Tripadvisor_Review_model extends CI_Model { function init() { $this->topnum = false; $this->where = false; - $this->orderby = " ORDER BY tr_datetime DESC "; + $this->orderby = " ORDER BY tr.tr_review_id DESC "; } function detail_tr_id($tr_id) { @@ -38,7 +38,7 @@ class Tripadvisor_Review_model extends CI_Model { $this->init(); $this->topnum = $topnum; $this->where = ' AND tr.tr_city =' . $this->INFO->escape($tr_city); - $this->orderby = " ORDER BY tr.tr_id DESC "; + $this->orderby = " ORDER BY tr.tr_review_id DESC "; return $this->GetList(); }