完成反馈标签功能,等网前数据库更新

hotfix/paypal-note
LiaoYijun 4 years ago
parent 2548a8080b
commit cf4640f5f9

@ -22,6 +22,7 @@ class Information extends CI_Controller
$this->load->model('Infoauthors_model'); $this->load->model('Infoauthors_model');
$this->load->model('InfoSMS_model'); $this->load->model('InfoSMS_model');
$this->load->model('recommends_and_tips_model'); $this->load->model('recommends_and_tips_model');
$this->load->model('Feedback_model');
$this->load->library('Amplib'); //加载AMP处理类 $this->load->library('Amplib'); //加载AMP处理类
$this->load->library('html_optimize_lib'); //加载HTML优化类 $this->load->library('html_optimize_lib'); //加载HTML优化类
@ -605,6 +606,26 @@ class Information extends CI_Controller
$template = str_replace('<!--@KEYWORDS@-->', $information->ic_seo_keywords, $template); $template = str_replace('<!--@KEYWORDS@-->', $information->ic_seo_keywords, $template);
$template = str_replace('<!--@CANONICAL@-->', $this->config->item('site_url') . $information->ic_url, $template); $template = str_replace('<!--@CANONICAL@-->', $this->config->item('site_url') . $information->ic_url, $template);
// 动态加载反馈标签
// HTLM: <div><!--@FEEDBACK_Shanghai@--></div>
// 解析结果:<!--@FEEDBACK_Shanghai@-->, Shanghai
$feedback_array = [];
preg_match_all('^<!--@FEEDBACK_(.*)@-->^', $template, $feedback_array);
if (!empty($feedback_array)) {
foreach ($feedback_array[0] as $index => $tag_name) {
// $city_name = $feedback_array[1][$index];
// $feedback_data = $this->feedback_model->get_feedback_by_city($city_name);
// $feedback_content = $this->load->view(
// $template_path . '-feedback',
// array('feedback_data' => $feedback_data),
// true);
// $template = str_replace(
// $tag_name,
// $feedback_content,
// $template);
}
}
//火车票搜索框添加 //火车票搜索框添加
if ($information->is_parent_id == "278008234") { if ($information->is_parent_id == "278008234") {
//本地测试的火车父类ID为278035939 。网前为278008234 //本地测试的火车父类ID为278035939 。网前为278008234

@ -0,0 +1,38 @@
<?php
class Feedback_model extends CI_Model {
function __construct() {
parent::__construct();
$this->HT = $this->load->database('HT', TRUE);
}
function get_feedback_by_city($city_name) {
$feedback_query =
$this->HT->query("
select top 1
tad_content, tai_customerid, tai_title, tai_getdate, tai_url, vci.cii2_name
from Eva_TAInfo
left join Eva_TADetail on TAD_TAI_SN=TAI_SN
left join V_CIty_Info vci on vci.cii_sn = tai_cii_sn and vci.LGC_LGC = 1
where TAD_Content is not null and vci.cii2_name = ?
order by tai_getdate desc",
array($city_name));
$feedback_row = $feedback_query->row();
$createdOn = new DateTime($feedback_row->tai_getdate);
$createdOnString = $createdOn->format('M Y');
$feedback = [
'title' => $feedback_row->tai_title,
'customer' => $feedback_row->tai_customerid,
'content' => $feedback_row->tad_content,
'url' => $feedback_row->tai_url,
'createdOn' => $createdOnString
];
return $feedback;
}
}

@ -0,0 +1,14 @@
<div class="about_ta">
<h3>About China Highlights</h3>
<p>Since 1959 we've guided everyone ranging from US presidents, Australian Geographic and retired backpackers. Our goal is to create unique trips that take you off-the-beaten path, helping you discover China in a more authentic way. Our motto: "Discovery Your Way!"</p>
<div class="infoimage"><img alt="travelers' choice 2020" src="https://data.chinahighlights.com/image/aboutus/feedback/Travelers_Choice_2020.png" loader="lazy">
</div>
</div>
<div class="feedback_content_right">
<div class="feedback_content">
<div class="content_name"><?php echo $feedback_data['customer'] ?> reviewed in <?php echo $feedback_data['createdOn'] ?></div>
<img alt="" class="feedback-rate" src="https://data.chinahighlights.com/image/aboutus/feedback/five-star.png" width="104" height="20">
<p><strong><?php echo $feedback_data['title'] ?></strong></p>
<p><?php echo $feedback_data['content'] ?>&nbsp;<a href="<?php echo $feedback_data['url'] ?>" target="_blank">more</a></p>
</div>
</div>
Loading…
Cancel
Save