diff --git a/application/controllers/information.php b/application/controllers/information.php index 10c03d2b..314d6241 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -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('', $information->ic_seo_keywords, $template); $template = str_replace('', $this->config->item('site_url') . $information->ic_url, $template); + // 动态加载反馈标签 + // HTLM:
+ // 解析结果:, Shanghai + $feedback_array = []; + preg_match_all('^^', $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 diff --git a/application/controllers/test.php b/application/controllers/test.php new file mode 100644 index 00000000..06d74e76 --- /dev/null +++ b/application/controllers/test.php @@ -0,0 +1,38 @@ +load->model('feedback_model'); + + } + + public function feedback() + { + $template_path = 'mobile_first/ch'; + + $feedback_array = array(); + preg_match_all('^^', '
', $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; + } + } + } + + +} diff --git a/application/models/feedback_model.php b/application/models/feedback_model.php new file mode 100644 index 00000000..11a0f8e8 --- /dev/null +++ b/application/models/feedback_model.php @@ -0,0 +1,38 @@ +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; + } +} diff --git a/application/views/mobile_first/ah-next.php b/application/views/mobile_first/ah-next.php index 612988e5..d37c1a23 100644 --- a/application/views/mobile_first/ah-next.php +++ b/application/views/mobile_first/ah-next.php @@ -11,14 +11,16 @@ @@ -26,14 +28,16 @@ @@ -41,14 +45,16 @@ @@ -56,14 +62,16 @@ @@ -72,14 +80,16 @@ @@ -88,14 +98,16 @@ @@ -104,14 +116,16 @@ @@ -120,14 +134,16 @@ diff --git a/application/views/mobile_first/ch-feedback.php b/application/views/mobile_first/ch-feedback.php new file mode 100644 index 00000000..fc5c994f --- /dev/null +++ b/application/views/mobile_first/ch-feedback.php @@ -0,0 +1,14 @@ +
+

About China Highlights

+

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!"

+
travelers' choice 2020 +
+
+
+
+
reviewed in
+ +

+

 more

+
+
\ No newline at end of file