CH 反馈改为列表

hotfix/paypal-note
LiaoYijun 4 years ago
parent 6d7626b6f0
commit 9561e0b60a

@ -626,18 +626,19 @@ class Information extends CI_Controller
$template = str_replace('<!--@KEYWORDS@-->', $information->ic_seo_keywords, $template);
$template = str_replace('<!--@CANONICAL@-->', $this->config->item('site_url') . $information->ic_url, $template);
// 动态加载反馈标签
// HTLM: <div><!--@FEEDBACK_Shanghai@--></div>
// 解析结果:<!--@FEEDBACK_Shanghai@-->, Shanghai
// 动态加载反馈标签,第一个城市不足八条,使用第二城市数据。
// HTLM: <div><!--@FEEDBACK_Shanghai,Beijing@--></div>
// 解析结果:<!--@FEEDBACK_Shanghai,Beijing@-->; Shanghai,Beijing
$feedback_array = [];
preg_match_all('^<!--@FEEDBACK_(.*)@-->^', $information->ic_content, $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);
$city_name_string = $feedback_array[1][$index];
$city_name_list = explode(',', $city_name_string);
$feedback_list = $this->Feedback_model->get_feedback_by_city_list($city_name_list);
$feedback_content = $this->load->view(
$template_path . '-feedback',
array('feedback_data' => $feedback_data),
$template_path . '-feedback-list',
array('feedback_list' => $feedback_list),
true);
$information->ic_content = str_replace(
$tag_name,

@ -0,0 +1,22 @@
<h2 style="text-align:center;">About China Highlights</h2>
<p style="text-align: center; padding-bottom: 10px;">Since 1998 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>
<p><img src="https://data.chinahighlights.com/image/feedback/2022-CH-TA-certificate.jpg" class="img-responsive" style="margin: 0 auto;"></p>
<div class="table-responsive">
<table>
<tbody>
<tr>
<?php foreach ($feedback_list as $index => $feedback) {?>
<td>
<div class="tour_feedback">
<div class="feedback_content">
<strong><?php echo $feedback['title'] ?></strong>
<p><?php echo $feedback['content'] ?></p>
<a href="<?php echo $feedback['url'] ?>" target="_blank">more</a></div>
<div class="customer_name"><?php echo $feedback['createdOn'] ?>, <?php echo $feedback['customer'] ?></div>
<img alt="" class="img-responsive" height="40" width="211" src="https://data.chinahighlights.com/image/aboutus/feedback/five-star.png" ></div>
</td>
<?php }?>
</tr>
</tbody>
</table>
</div>
Loading…
Cancel
Save