Merge branch 'master' of github.com:hainatravel/information-system

hotfix/paypal-note
赵鹏 4 years ago
commit 887c8bae58

@ -22,6 +22,7 @@ class Information extends CI_Controller
$this->load->model('Infoauthors_model');
$this->load->model('InfoSMS_model');
$this->load->model('recommends_and_tips_model');
$this->load->model('Feedback_model');
$this->load->library('Amplib'); //加载AMP处理类
$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('<!--@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") {
//本地测试的火车父类ID为278035939 。网前为278008234

@ -0,0 +1,38 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Test extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->model('feedback_model');
}
public function feedback()
{
$template_path = 'mobile_first/ch';
$feedback_array = array();
preg_match_all('^<!--@FEEDBACK_(.*)@-->^', '<html><div><!--@FEEDBACK_Shanghai@--></div></html>', $feedback_array);
if (!empty($feedback_array)) {
foreach ($feedback_array[0] as $index => $tag_name) {
$city_name = $feedback_array[1][$index];
echo $city_name;
echo htmlentities($tag_name);
$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);
echo $feedback_content;
}
}
}
}

@ -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;
}
}

@ -11,14 +11,16 @@
<?php if(!empty($recommands['Article A'])){ ?>
<td>
<div class="nextarticle">
<a href="<?php echo $recommands['Article A']->ic_url; ?>"> <img
<img
src="https://data.asiahighlights.com/grey.gif" loader="lazy"
originalsrc="<?php echo $recommands['Article A']->mobile_photo; ?>"
class="img-responsive" alt="<?php echo $recommands['Article A']->ic_title; ?>"></a>
class="img-responsive" alt="<?php echo $recommands['Article A']->ic_title; ?>">
<div class="nextarticlebg">
<div class="nextarticlename">
<a href="<?php echo $recommands['Article A']->ic_url; ?>"> <?php echo $recommands['Article A']->ic_title; ?> </a>
</div>
<div class="tournextbutton"><a href="<?php echo $recommands['Article A']->ic_url; ?>"
rel="nofollow">Explore</a></div>
</div>
</div></td>
<?php } ?>
@ -26,14 +28,16 @@
<?php if(!empty($recommands['Article B'])){ ?>
<td>
<div class="nextarticle">
<a href="<?php echo $recommands['Article B']->ic_url; ?>"> <img
<img
src="https://data.asiahighlights.com/grey.gif" loader="lazy"
originalsrc="<?php echo $recommands['Article B']->mobile_photo; ?>"
class="img-responsive" alt="<?php echo $recommands['Article B']->ic_title; ?>"></a>
class="img-responsive" alt="<?php echo $recommands['Article B']->ic_title; ?>">
<div class="nextarticlebg">
<div class="nextarticlename">
<a href="<?php echo $recommands['Article B']->ic_url; ?>"> <?php echo $recommands['Article B']->ic_title; ?> </a>
</div>
<div class="tournextbutton"><a href="<?php echo $recommands['Article B']->ic_url; ?>"
rel="nofollow">Explore</a></div>
</div>
</div></td>
<?php } ?>
@ -41,14 +45,16 @@
<?php if(!empty($recommands['Article C'])){ ?>
<td>
<div class="nextarticle">
<a href="<?php echo $recommands['Article C']->ic_url; ?>"> <img
<img
src="https://data.asiahighlights.com/grey.gif" loader="lazy"
originalsrc="<?php echo $recommands['Article C']->mobile_photo; ?>"
class="img-responsive" alt="<?php echo $recommands['Article C']->ic_title; ?>"></a>
class="img-responsive" alt="<?php echo $recommands['Article C']->ic_title; ?>">
<div class="nextarticlebg">
<div class="nextarticlename">
<a href="<?php echo $recommands['Article C']->ic_url; ?>"> <?php echo $recommands['Article C']->ic_title; ?> </a>
</div>
<div class="tournextbutton"><a href="<?php echo $recommands['Article C']->ic_url; ?>"
rel="nofollow">Explore</a></div>
</div>
</div></td>
<?php } ?>
@ -56,14 +62,16 @@
<?php if(!empty($recommands['Article D'])){ ?>
<td>
<div class="nextarticle">
<a href="<?php echo $recommands['Article D']->ic_url; ?>"> <img
<img
src="https://data.asiahighlights.com/grey.gif" loader="lazy"
originalsrc="<?php echo $recommands['Article D']->mobile_photo; ?>"
class="img-responsive" alt="<?php echo $recommands['Article D']->ic_title; ?>"></a>
class="img-responsive" alt="<?php echo $recommands['Article D']->ic_title; ?>">
<div class="nextarticlebg">
<div class="nextarticlename">
<a href="<?php echo $recommands['Article D']->ic_url; ?>"> <?php echo $recommands['Article D']->ic_title; ?> </a>
</div>
<div class="tournextbutton"><a href="<?php echo $recommands['Article D']->ic_url; ?>"
rel="nofollow">Explore</a></div>
</div>
</div>
</td>
@ -72,14 +80,16 @@
<?php if(!empty($recommands['Article E'])){ ?>
<td>
<div class="nextarticle">
<a href="<?php echo $recommands['Article E']->ic_url; ?>"> <img
<img
src="https://data.asiahighlights.com/grey.gif" loader="lazy"
originalsrc="<?php echo $recommands['Article E']->mobile_photo; ?>"
class="img-responsive" alt="<?php echo $recommands['Article E']->ic_title; ?>"></a>
class="img-responsive" alt="<?php echo $recommands['Article E']->ic_title; ?>">
<div class="nextarticlebg">
<div class="nextarticlename">
<a href="<?php echo $recommands['Article E']->ic_url; ?>"> <?php echo $recommands['Article E']->ic_title; ?> </a>
</div>
<div class="tournextbutton"><a href="<?php echo $recommands['Article E']->ic_url; ?>"
rel="nofollow">Explore</a></div>
</div>
</div>
</td>
@ -88,14 +98,16 @@
<?php if(!empty($recommands['Article F'])){ ?>
<td>
<div class="nextarticle">
<a href="<?php echo $recommands['Article F']->ic_url; ?>"> <img
<img
src="https://data.asiahighlights.com/grey.gif" loader="lazy"
originalsrc="<?php echo $recommands['Article F']->mobile_photo; ?>"
class="img-responsive" alt="<?php echo $recommands['Article F']->ic_title; ?>"></a>
class="img-responsive" alt="<?php echo $recommands['Article F']->ic_title; ?>">
<div class="nextarticlebg">
<div class="nextarticlename">
<a href="<?php echo $recommands['Article F']->ic_url; ?>"> <?php echo $recommands['Article F']->ic_title; ?> </a>
</div>
<div class="tournextbutton"><a href="<?php echo $recommands['Article F']->ic_url; ?>"
rel="nofollow">Explore</a></div>
</div>
</div>
</td>
@ -104,14 +116,16 @@
<?php if(!empty($recommands['Article G'])){ ?>
<td>
<div class="nextarticle">
<a href="<?php echo $recommands['Article G']->ic_url; ?>"> <img
<img
src="https://data.asiahighlights.com/grey.gif" loader="lazy"
originalsrc="<?php echo $recommands['Article G']->mobile_photo; ?>"
class="img-responsive" alt="<?php echo $recommands['Article G']->ic_title; ?>"></a>
class="img-responsive" alt="<?php echo $recommands['Article G']->ic_title; ?>">
<div class="nextarticlebg">
<div class="nextarticlename">
<a href="<?php echo $recommands['Article G']->ic_url; ?>"> <?php echo $recommands['Article G']->ic_title; ?> </a>
</div>
<div class="tournextbutton"><a href="<?php echo $recommands['Article G']->ic_url; ?>"
rel="nofollow">Explore</a></div>
</div>
</div>
</td>
@ -120,14 +134,16 @@
<?php if(!empty($recommands['Article H'])){ ?>
<td>
<div class="nextarticle">
<a href="<?php echo $recommands['Article H']->ic_url; ?>"> <img
<img
src="https://data.asiahighlights.com/grey.gif" loader="lazy"
originalsrc="<?php echo $recommands['Article H']->mobile_photo; ?>"
class="img-responsive" alt="<?php echo $recommands['Article H']->ic_title; ?>"></a>
class="img-responsive" alt="<?php echo $recommands['Article H']->ic_title; ?>">
<div class="nextarticlebg">
<div class="nextarticlename">
<a href="<?php echo $recommands['Article H']->ic_url; ?>"> <?php echo $recommands['Article H']->ic_title; ?> </a>
</div>
<div class="tournextbutton"><a href="<?php echo $recommands['Article H']->ic_url; ?>"
rel="nofollow">Explore</a></div>
</div>
</div>
</td>

@ -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