From cf4640f5f9e5e008772d339184d0e6ce6fcc8251 Mon Sep 17 00:00:00 2001 From: LiaoYijun Date: Tue, 17 Aug 2021 15:26:13 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=8F=8D=E9=A6=88?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=8A=9F=E8=83=BD=EF=BC=8C=E7=AD=89=E7=BD=91?= =?UTF-8?q?=E5=89=8D=E6=95=B0=E6=8D=AE=E5=BA=93=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/information.php | 21 ++++++++++ application/models/feedback_model.php | 38 +++++++++++++++++++ .../views/mobile_first/ch-feedback.php | 14 +++++++ 3 files changed, 73 insertions(+) create mode 100644 application/models/feedback_model.php create mode 100644 application/views/mobile_first/ch-feedback.php diff --git a/application/controllers/information.php b/application/controllers/information.php index 1e846a4c..2961e49e 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/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/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 +
+
+
+ +
\ No newline at end of file From 023fd6543292c958da6780f544010689562ae0a2 Mon Sep 17 00:00:00 2001 From: LiaoYijun Date: Wed, 18 Aug 2021 09:57:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=8F=8D=E9=A6=88?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/test.php | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 application/controllers/test.php 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; + } + } + } + + +} From 23e13e5f43688d3f7fe31e6123932d2e14789402 Mon Sep 17 00:00:00 2001 From: candice Date: Wed, 18 Aug 2021 11:12:00 +0800 Subject: [PATCH 3/3] 11 --- application/views/mobile_first/ah-next.php | 48 ++++++++++++++-------- 1 file changed, 32 insertions(+), 16 deletions(-) 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 @@