|
|
|
@ -434,17 +434,21 @@ class Index extends CI_Controller {
|
|
|
|
|
header("HTTP/1.1 404 Not Found");
|
|
|
|
|
exit('{"status":"404","reason":"请输入站点代码!"}');
|
|
|
|
|
}else{
|
|
|
|
|
$return_data = array();
|
|
|
|
|
$ta_website = $this->config->item('tripadvisor_website');
|
|
|
|
|
if(empty($ta_website[$destination])){
|
|
|
|
|
header("HTTP/1.1 404 Not Found");
|
|
|
|
|
exit('{"status":"404","reason":"请输入正确的站点代码!"}');
|
|
|
|
|
}
|
|
|
|
|
$product_code = $this->input->get_post('productCode');
|
|
|
|
|
|
|
|
|
|
$return_data['list_url'] = str_replace('{PAGENUM}','',$ta_website[$destination]);
|
|
|
|
|
if(empty($product_code)){
|
|
|
|
|
$return_data = array();
|
|
|
|
|
$ta_website = $this->config->item('tripadvisor_website');
|
|
|
|
|
if(empty($ta_website[$destination])){
|
|
|
|
|
header("HTTP/1.1 404 Not Found");
|
|
|
|
|
exit('{"status":"404","reason":"请输入正确的站点代码!"}');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$return_data['list_url'] = str_replace('{PAGENUM}','',$ta_website[$destination]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据站点获取评论
|
|
|
|
|
$list_reviews = $this->Tripadvisor_Review_model->get_fivelatestreviews($destination);
|
|
|
|
|
$list_reviews = $this->Tripadvisor_Review_model->get_fivelatestreviews($destination,$product_code);
|
|
|
|
|
$return_data['list_reviews'] = $list_reviews;
|
|
|
|
|
print_r(json_encode($return_data));
|
|
|
|
|
}
|
|
|
|
|