hotfix/paypal-note
LMR 2 years ago
parent ec13581dfa
commit 416bdfa0c8

@ -571,7 +571,7 @@ class Information extends CI_Controller
} else {
return false;
}
break;
// break;
case 'delete':
if (is_file($html_file_mobile)) {
unlink($html_file_mobile);
@ -662,20 +662,20 @@ class Information extends CI_Controller
$feedback30_array = [];
preg_match_all('^<!--@FEEDBACK-30_(.*)@-->^', $information->ic_content, $feedback30_array);
if (!empty($feedback30_array)) {
foreach ($feedback30_array[0] as $index => $tag_name) {
$city_name = $feedback30_array[1][$index];
$feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name);
$feedback_30_content = $this->load->view(
'mobile_first/ch-feedback-30-list',
array('feedback_list' => $feedback_list),
true
);
$information->ic_content = str_replace(
$tag_name,
$feedback_30_content,
$information->ic_content
);
}
foreach ($feedback30_array[0] as $index => $tag_name) {
$city_name = $feedback30_array[1][$index];
$feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name);
$feedback_30_content = $this->load->view(
'mobile_first/ch-feedback-30-list',
array('feedback_list' => $feedback_list),
true
);
$information->ic_content = str_replace(
$tag_name,
$feedback_30_content,
$information->ic_content
);
}
}
$feedback_newest = $this->Feedback_model->get_feedback_newest();
@ -1007,103 +1007,104 @@ class Information extends CI_Controller
public function test_recommand()
{
$information = $this->Information_model->Detail($this->input->get('is_id'));
$recommand_information = $this->recommand_information($information);
// var_dump($recommand_information);
$tips_right_a = [];
$tips_right_b = [];
$tips_right_c = [];
for ($i=1; $i <= 12; $i++) {
$key = 'List Tips Right A_'.$i;
if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) {
$tips_right_a[] = $recommand_information[$key];
}
}
for ($i=1; $i <= 12; $i++) {
$key = 'List Tips Right B_'.$i;
if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) {
$tips_right_b[] = $recommand_information[$key];
}
}
for ($i=1; $i <= 12; $i++) {
$key = 'List Tips Right C_'.$i;
if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) {
$tips_right_c[] = $recommand_information[$key];
}
}
echo 'List Tips Right A: '.COUNT($tips_right_a);
echo '; List Tips Right B: '.COUNT($tips_right_b);
echo '; List Tips Right C: '.COUNT($tips_right_c);
$tips_right_list_content = $this->load->view(
'mobile_first/ah-tips-right-list',
array(
'tips_right_a' => $tips_right_a,
'tips_right_b' => $tips_right_b,
'tips_right_c' => $tips_right_c),
true
);
echo $tips_right_list_content;
$information = $this->Information_model->Detail($this->input->get('is_id'));
$recommand_information = $this->recommand_information($information);
// var_dump($recommand_information);
$tips_right_a = [];
$tips_right_b = [];
$tips_right_c = [];
for ($i = 1; $i <= 12; $i++) {
$key = 'List Tips Right A_' . $i;
if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) {
$tips_right_a[] = $recommand_information[$key];
}
}
for ($i = 1; $i <= 12; $i++) {
$key = 'List Tips Right B_' . $i;
if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) {
$tips_right_b[] = $recommand_information[$key];
}
}
for ($i = 1; $i <= 12; $i++) {
$key = 'List Tips Right C_' . $i;
if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) {
$tips_right_c[] = $recommand_information[$key];
}
}
echo 'List Tips Right A: ' . COUNT($tips_right_a);
echo '; List Tips Right B: ' . COUNT($tips_right_b);
echo '; List Tips Right C: ' . COUNT($tips_right_c);
$tips_right_list_content = $this->load->view(
'mobile_first/ah-tips-right-list',
array(
'tips_right_a' => $tips_right_a,
'tips_right_b' => $tips_right_b,
'tips_right_c' => $tips_right_c
),
true
);
echo $tips_right_list_content;
}
public function test_feedback()
{
$feedback_newest = $this->Feedback_model->test_feedback_newest();
var_dump($feedback_newest);
$feedback_newest = $this->Feedback_model->test_feedback_newest();
var_dump($feedback_newest);
}
public function test_feedback30()
{
$feedback30_array = [];
preg_match_all('^<!--@FEEDBACK-30_(.*)@-->^', '<div><!--@FEEDBACK-30_Bangkok@--></div>', $feedback30_array);
if (!empty($feedback30_array)) {
foreach ($feedback30_array[0] as $index => $tag_name) {
$city_name = $feedback30_array[1][$index];
$feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name, 2);
$feedback_content = $this->load->view(
'mobile_first/ah-feedback-30-list',
array('feedback_list' => $feedback_list),
true
);
echo $feedback_content;
$feedback30_array = [];
preg_match_all('^<!--@FEEDBACK-30_(.*)@-->^', '<div><!--@FEEDBACK-30_Bangkok@--></div>', $feedback30_array);
if (!empty($feedback30_array)) {
foreach ($feedback30_array[0] as $index => $tag_name) {
$city_name = $feedback30_array[1][$index];
$feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name, 2);
$feedback_content = $this->load->view(
'mobile_first/ah-feedback-30-list',
array('feedback_list' => $feedback_list),
true
);
echo $feedback_content;
}
}
}
}
public function test_feedback_city_list()
{
$feedback_city_array = [];
preg_match_all('^<!--@FEEDBACK-CITY-LIST_(.*)@-->^', '<div><!--@FEEDBACK-CITY-LIST_Bangkok,Hanoi,Tokyo,Delhi,Yangon,Beijing@--></div>', $feedback_city_array);
if (!empty($feedback_city_array)) {
foreach ($feedback_city_array[0] as $index => $tag_name) {
$city_name_string = $feedback_city_array[1][$index];
$city_name_list = explode(',', $city_name_string);
$feedback_city_list = [];
foreach ($city_name_list as $index => $city_name) {
$feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name, 5);
$data_name = str_replace(" ", "_", $city_name);
$feedback_city_list[$data_name] = $feedback_list;
}
// header('Content-Type: application/json');
// echo json_encode($feedback_city_list);
$feedback_content = $this->load->view(
'mobile_first/ah-feedback-city-list',
$feedback_city_list,
true
);
echo $feedback_content;
$feedback_city_array = [];
preg_match_all('^<!--@FEEDBACK-CITY-LIST_(.*)@-->^', '<div><!--@FEEDBACK-CITY-LIST_Bangkok,Hanoi,Tokyo,Delhi,Yangon,Beijing@--></div>', $feedback_city_array);
if (!empty($feedback_city_array)) {
foreach ($feedback_city_array[0] as $index => $tag_name) {
$city_name_string = $feedback_city_array[1][$index];
$city_name_list = explode(',', $city_name_string);
$feedback_city_list = [];
foreach ($city_name_list as $index => $city_name) {
$feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name, 5);
$data_name = str_replace(" ", "_", $city_name);
$feedback_city_list[$data_name] = $feedback_list;
}
// header('Content-Type: application/json');
// echo json_encode($feedback_city_list);
$feedback_content = $this->load->view(
'mobile_first/ah-feedback-city-list',
$feedback_city_list,
true
);
echo $feedback_content;
}
}
}
}
public function test_price()
{
$price_rule = '<div style="color: red;">#ah-8,st,2#</div><div style="color: red;">#ah-8,st,2#</div>';
$price_tag_list = $this->parse_price_tag($price_rule);
var_dump($price_tag_list);
$price_rule = '<div style="color: red;">#ah-8,st,2#</div><div style="color: red;">#ah-8,st,2#</div>';
$price_tag_list = $this->parse_price_tag($price_rule);
var_dump($price_tag_list);
}
/*!
@ -1140,7 +1141,7 @@ class Information extends CI_Controller
case 'AR':
$price_number = $price->PLP_AdultUnitPrice + $price->PLP_RoomDiffPrice; //成人加单间房差
break;
default :
default:
$price_number = $price->PLP_AdultUnitPrice;
}
} else {
@ -1153,10 +1154,10 @@ class Information extends CI_Controller
case '1':
$price_number = $price->CLP_OneAdultPriceRMB;
break;
case '2'://25
case '2': //25
$price_number = $price->CLP_TwoToFiveAdultPriceRMB;
break;
case '6'://69
case '6': //69
$price_number = $price->CLP_SixToNineAdultPriceRMB;
break;
case '10':
@ -1177,10 +1178,10 @@ class Information extends CI_Controller
case '1':
$price_number = $price->CLP_OneRoomDiffPriceRMB;
break;
case '2'://25
case '2': //25
$price_number = $price->CLP_TwoToFiveRoomDiffPriceRMB;
break;
case '6'://69
case '6': //69
$price_number = $price->CLP_SixToNineRoomDiffPriceRMB;
break;
case '10':
@ -1190,10 +1191,10 @@ class Information extends CI_Controller
$price_number = $price->CLP_TwoToFiveRoomDiffPriceRMB;
}
break;
case 'AR'://成人加单间房差
case 'AR': //成人加单间房差
$price_number = 0;
break;
default :
default:
$price_number = 0;
}
}
@ -1202,11 +1203,11 @@ class Information extends CI_Controller
//把金额格式化为带有逗号(,)方便阅读,如 12,345
$price_number = is_numeric($price_number) ? number_format($site_money) : $price_number;
if (!empty($price_number)) {
$price_tag = [
'placeholder' => $price_item->placeholder,
'price_number' => $price_number,
];
$price_tag_list[] = $price_tag;
$price_tag = [
'placeholder' => $price_item->placeholder,
'price_number' => $price_number,
];
$price_tag_list[] = $price_tag;
}
}
}
@ -1214,50 +1215,52 @@ class Information extends CI_Controller
}
//使用正则匹配出价格标签,返回一个价格数组
private function price_pregmatch($content) {
$price_array = array();
$temp_array = array();
$result = false;
//#ah-1,lx,2,2016-01-23,A#
//线路代号,等级(st标准、lx豪华、ec经济),人等,时间,人型(A成人、C小孩、B婴儿、R单间房差、AR成人+房差)
preg_match_all('^#[a-zA-Z0-9,-]+#^', $content, $temp_array);
foreach ($temp_array[0] as $item) {
$placeholder = $item;
$item = str_replace('#', '', $item);
$price_array = explode(',', $item);
$cli_no = !empty($price_array[0]) ? $price_array[0] : false; //线路代号
if (empty($cli_no)) {
continue; //没有设置线路代号则进入下一条
}
$cli_grade = !empty($price_array[1]) ? $price_array[1] : false; //标准7001、豪华7002、经济7003
switch (strtoupper($cli_grade)) {
case 'ST':
$cli_grade = '7001';
break;
case 'LX':
$cli_grade = '7002';
break;
case 'EC':
$cli_grade = '7003';
break;
default :$cli_grade = '7001';
}
$person_size = (!empty($price_array[2]) && is_numeric($price_array[2])) ? $price_array[2] : 2; //人等1,2-5,6-9,10默认2人等
//为了兼容以前的人等方式,把算数人等转换为单数 25=>2
switch ($person_size) {
case '25':
$person_size = '2';
break;
case '69':
$person_size = '6';
break;
}
$price_date = !empty($price_array[3]) ? $price_array[3] : false; //价格时间
$price_people = !empty($price_array[4]) ? $price_array[4] : 'A'; //A成人、C小孩、B婴儿、R单间房差
$result[] = (object) array('placeholder' => $placeholder, 'cli_no' => $cli_no, 'cli_grade' => $cli_grade, 'person_size' => $person_size, 'price_date' => $price_date, 'price_people' => $price_people);
}
return $result;
}
private function price_pregmatch($content)
{
$price_array = array();
$temp_array = array();
$result = false;
//#ah-1,lx,2,2016-01-23,A#
//线路代号,等级(st标准、lx豪华、ec经济),人等,时间,人型(A成人、C小孩、B婴儿、R单间房差、AR成人+房差)
preg_match_all('^#[a-zA-Z0-9,-]+#^', $content, $temp_array);
foreach ($temp_array[0] as $item) {
$placeholder = $item;
$item = str_replace('#', '', $item);
$price_array = explode(',', $item);
$cli_no = !empty($price_array[0]) ? $price_array[0] : false; //线路代号
if (empty($cli_no)) {
continue; //没有设置线路代号则进入下一条
}
$cli_grade = !empty($price_array[1]) ? $price_array[1] : false; //标准7001、豪华7002、经济7003
switch (strtoupper($cli_grade)) {
case 'ST':
$cli_grade = '7001';
break;
case 'LX':
$cli_grade = '7002';
break;
case 'EC':
$cli_grade = '7003';
break;
default:
$cli_grade = '7001';
}
$person_size = (!empty($price_array[2]) && is_numeric($price_array[2])) ? $price_array[2] : 2; //人等1,2-5,6-9,10默认2人等
//为了兼容以前的人等方式,把算数人等转换为单数 25=>2
switch ($person_size) {
case '25':
$person_size = '2';
break;
case '69':
$person_size = '6';
break;
}
$price_date = !empty($price_array[3]) ? $price_array[3] : false; //价格时间
$price_people = !empty($price_array[4]) ? $price_array[4] : 'A'; //A成人、C小孩、B婴儿、R单间房差
$result[] = (object) array('placeholder' => $placeholder, 'cli_no' => $cli_no, 'cli_grade' => $cli_grade, 'person_size' => $person_size, 'price_date' => $price_date, 'price_people' => $price_people);
}
return $result;
}
public function make_www_cache_gh($device, $information, $recommand_information)
{
@ -1365,9 +1368,9 @@ class Information extends CI_Controller
}
if (empty($meta_product_code)) {
$template = str_replace('?product_code=', '', $template);
$template = str_replace('?product_code=', '', $template);
} else {
$template = str_replace('?product_code=', '?product_code=' . $meta_product_code, $template);
$template = str_replace('?product_code=', '?product_code=' . $meta_product_code, $template);
}
//信息推荐
@ -1415,15 +1418,15 @@ class Information extends CI_Controller
$information->ic_content = str_replace('<!--@WHY-US-COVID-MOBILE@-->', $why_us_covid_list_mobile, $information->ic_content);
if (empty($meta_product_code)) {
$info_page_form_content = $this->load->view($template_path . '-info-page-form', false, true);
$information->ic_content = str_replace('<!--@INFO-PAGE-FORM@-->', $info_page_form_content, $information->ic_content);
$info_page_form_content = $this->load->view($template_path . '-info-page-form', false, true);
$information->ic_content = str_replace('<!--@INFO-PAGE-FORM@-->', $info_page_form_content, $information->ic_content);
} else {
$tour_form_content = $this->load->view(
$template_path . '-tour-form',
array('information' => $information, 'meta_product_code' => $meta_product_code),
true
);
$information->ic_content = str_replace('<!--@TOUR-FORM-TAG@-->', $tour_form_content, $information->ic_content);
$tour_form_content = $this->load->view(
$template_path . '-tour-form',
array('information' => $information, 'meta_product_code' => $meta_product_code),
true
);
$information->ic_content = str_replace('<!--@TOUR-FORM-TAG@-->', $tour_form_content, $information->ic_content);
}
// 动态加载反馈标签,每个城市三十条反馈。
@ -1432,20 +1435,20 @@ class Information extends CI_Controller
$feedback30_array = [];
preg_match_all('^<!--@FEEDBACK-30_(.*)@-->^', $information->ic_content, $feedback30_array);
if (!empty($feedback30_array)) {
foreach ($feedback30_array[0] as $index => $tag_name) {
$city_name = $feedback30_array[1][$index];
$feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name);
$feedback_30_content = $this->load->view(
'mobile_first/gh-feedback-30-list',
array('feedback_list' => $feedback_list),
true
);
$information->ic_content = str_replace(
$tag_name,
$feedback_30_content,
$information->ic_content
);
}
foreach ($feedback30_array[0] as $index => $tag_name) {
$city_name = $feedback30_array[1][$index];
$feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name);
$feedback_30_content = $this->load->view(
'mobile_first/gh-feedback-30-list',
array('feedback_list' => $feedback_list),
true
);
$information->ic_content = str_replace(
$tag_name,
$feedback_30_content,
$information->ic_content
);
}
}
$feedback_newest = $this->Feedback_model->get_feedback_newest();
@ -1620,34 +1623,35 @@ class Information extends CI_Controller
$tips_right_a = [];
$tips_right_b = [];
$tips_right_c = [];
for ($i=1; $i <= 12; $i++) {
$key = 'List Tips Right A_'.$i;
if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) {
$tips_right_a[] = $recommand_information[$key];
}
for ($i = 1; $i <= 12; $i++) {
$key = 'List Tips Right A_' . $i;
if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) {
$tips_right_a[] = $recommand_information[$key];
}
}
for ($i=1; $i <= 12; $i++) {
$key = 'List Tips Right B_'.$i;
if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) {
$tips_right_b[] = $recommand_information[$key];
}
for ($i = 1; $i <= 12; $i++) {
$key = 'List Tips Right B_' . $i;
if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) {
$tips_right_b[] = $recommand_information[$key];
}
}
for ($i=1; $i <= 12; $i++) {
$key = 'List Tips Right C_'.$i;
if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) {
$tips_right_c[] = $recommand_information[$key];
}
for ($i = 1; $i <= 12; $i++) {
$key = 'List Tips Right C_' . $i;
if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) {
$tips_right_c[] = $recommand_information[$key];
}
}
$tips_right_list_content = $this->load->view(
'mobile_first/ah-tips-right-list',
array(
'tips_right_a' => $tips_right_a,
'tips_right_b' => $tips_right_b,
'tips_right_c' => $tips_right_c),
true
'mobile_first/ah-tips-right-list',
array(
'tips_right_a' => $tips_right_a,
'tips_right_b' => $tips_right_b,
'tips_right_c' => $tips_right_c
),
true
);
$template = str_replace('<!--@TIPS-RIGHT-LIST@-->', $tips_right_list_content, $template);
//文中的信息推荐
@ -1713,11 +1717,11 @@ class Information extends CI_Controller
$price_tag_list = $this->parse_price_tag($information->ic_content);
foreach ($price_tag_list as $price_tag) {
$information->ic_content = str_replace(
$price_tag['placeholder'],
$price_tag['price_number'],
$information->ic_content
);
$information->ic_content = str_replace(
$price_tag['placeholder'],
$price_tag['price_number'],
$information->ic_content
);
}
}
// why-us 相关的标签
@ -1777,47 +1781,47 @@ class Information extends CI_Controller
$feedback30_array = [];
preg_match_all('^<!--@FEEDBACK-30_(.*)@-->^', $information->ic_content, $feedback30_array);
if (!empty($feedback30_array)) {
foreach ($feedback30_array[0] as $index => $tag_name) {
$city_name = $feedback30_array[1][$index];
$feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name);
$feedback_30_content = $this->load->view(
'mobile_first/ah-feedback-30-list',
array('feedback_list' => $feedback_list),
true
);
$information->ic_content = str_replace(
$tag_name,
$feedback_30_content,
$information->ic_content
);
}
foreach ($feedback30_array[0] as $index => $tag_name) {
$city_name = $feedback30_array[1][$index];
$feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name);
$feedback_30_content = $this->load->view(
'mobile_first/ah-feedback-30-list',
array('feedback_list' => $feedback_list),
true
);
$information->ic_content = str_replace(
$tag_name,
$feedback_30_content,
$information->ic_content
);
}
}
// 集合页面反馈标签
$feedback_city_array = [];
preg_match_all('^<!--@FEEDBACK-CITY-LIST_(.*)@-->^', $information->ic_content, $feedback_city_array);
if (!empty($feedback_city_array)) {
foreach ($feedback_city_array[0] as $index => $tag_name) {
$city_name_string = $feedback_city_array[1][$index];
$city_name_list = explode(',', $city_name_string);
$feedback_city_list = [];
foreach ($city_name_list as $index => $city_name) {
$feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name, 5);
$data_name = str_replace(" ", "_", $city_name);
$feedback_city_list[$data_name] = $feedback_list;
}
$feedback_city_content = $this->load->view(
'mobile_first/ah-feedback-city-list',
$feedback_city_list,
true
);
$information->ic_content = str_replace(
$tag_name,
$feedback_city_content,
$information->ic_content
);
}
foreach ($feedback_city_array[0] as $index => $tag_name) {
$city_name_string = $feedback_city_array[1][$index];
$city_name_list = explode(',', $city_name_string);
$feedback_city_list = [];
foreach ($city_name_list as $index => $city_name) {
$feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name, 5);
$data_name = str_replace(" ", "_", $city_name);
$feedback_city_list[$data_name] = $feedback_list;
}
$feedback_city_content = $this->load->view(
'mobile_first/ah-feedback-city-list',
$feedback_city_list,
true
);
$information->ic_content = str_replace(
$tag_name,
$feedback_city_content,
$information->ic_content
);
}
}
$feedback_newest = $this->Feedback_model->get_feedback_newest();
@ -1980,12 +1984,12 @@ class Information extends CI_Controller
$data["PRODUCTJS"] = "";
$data["ISPRODUCT"] = "no"; //判断是否是产品页
$data["addthis_widget"] = "";
$data["FloatIcon"]=""; //浮动图标替代addthis
$arrExitUrl = array("/","/culture","/guide","/tour","/citytour","/daytrip","/asia-tour","/china-trains");
$data["FloatIcon"] = ""; //浮动图标替代addthis
$arrExitUrl = array("/", "/culture", "/guide", "/tour", "/citytour", "/daytrip", "/asia-tour", "/china-trains");
if (empty(get_meta($information->ic_id, 'meta_product_code')) || in_array($information->ic_url,$arrExitUrl)) {
if (empty(get_meta($information->ic_id, 'meta_product_code')) || in_array($information->ic_url, $arrExitUrl)) {
//$data["addthis_widget"] = $this->load->view($template_path . '-add-this', false, true); //社媒代码addthis
$data["FloatIcon"]="<div class=\"fixed-tm\"><a href=\"/forms/customize\" >Create My Trip</a></div>";
$data["FloatIcon"] = "<div class=\"fixed-tm\"><a href=\"/forms/customize\" >Create My Trip</a></div>";
} else {
// $data["PRODUCTJS"] = '<script src="https://data.chinatravel.com/js/mobile-first/flatpickr.js"></script>';
$data["ISPRODUCT"] = "yes";
@ -2292,10 +2296,10 @@ class Information extends CI_Controller
case 'rule_show_tips': //显示广告
$data = $this->recommends_and_tips_model->tips_detail($recommand->ir_pointer_it_id);
return array($recommand->ir_name => $data);
break;
//break;
case 'rule_no_show': //不显示
return array($recommand->ir_name => false);
break;
//break;
default: //'rule_parent'://继承上级规则则留空,程序会循环一遍分组的规则
return false;
}
@ -2568,7 +2572,7 @@ class Information extends CI_Controller
break;
default:
return false;
break;
//break;
}
$content = GET_HTTP($url);
@ -2707,4 +2711,4 @@ class Information extends CI_Controller
echo json_encode($data);
return true;
}
}
}
Loading…
Cancel
Save