From e458743c185f750956b2c5458ed6ed609c04ed0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Tue, 24 Sep 2024 11:00:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?chinatravel=E7=AB=99=E7=82=B9TA=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E8=8E=B7=E5=8F=96=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/information.php | 25 ++++++++ application/models/feedback_model.php | 59 +++++++++++++++++++ .../chinatravel-feedback-list.php | 17 ++++++ 3 files changed, 101 insertions(+) create mode 100644 application/views/mobile_first/chinatravel-feedback-list.php diff --git a/application/controllers/information.php b/application/controllers/information.php index 510213d1..d797f72d 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -2594,6 +2594,31 @@ class Information extends CI_Controller $ic_content = str_replace('', $zodiacCalc, $ic_content); } + + // 动态加载反馈标签,按城市出前三条。 + // HTLM:
,显示全部用 + // 解析结果:; Shanghai,Beijing + $feedback_array = []; + preg_match_all('^^', $information->ic_content, $feedback_array); + if (!empty($feedback_array)) { + foreach ($feedback_array[0] as $index => $tag_name) { + $city_name_string = $feedback_array[1][$index]; + $feedback_list = $this->Feedback_model->get_CT_feedback_by_cityname($city_name_string,30); + // 防止触发 Google 网络垃圾政策只返回前三条 + $top3_feedback_list = array_slice($feedback_list, 0, 3); + $feedback_content = $this->load->view( + 'mobile_first/chinatravel-feedback-list', + array('feedback_list' => $top3_feedback_list), + true + ); + $ic_content = str_replace( + $tag_name, + $feedback_content, + $ic_content + ); + } + } + //图片加延迟 $ic_content = $this->html_optimize_lib->set_lazy_loader($ic_content, 'https://data.chinatravel.com/images/mobile-first/grey.gif'); diff --git a/application/models/feedback_model.php b/application/models/feedback_model.php index 8d6ed713..ae158ea1 100644 --- a/application/models/feedback_model.php +++ b/application/models/feedback_model.php @@ -252,4 +252,63 @@ class Feedback_model extends CI_Model { return $feedback_list; } + + + /*** + * CT站获取反馈信息列表,根据城市 + * // HTLM:
+ // 解析结果:; Shanghai,Beijing + */ + function get_CT_feedback_by_cityname($city,$top=30){ + $sql = " + select top ? + 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 "; + //根据传递的城市名称进行判断 + if ($city == "All" || empty($city)){ + + }else{ + // 使用 explode 函数分割字符串,并去除空格 + $cityArray = array_map('trim', explode(',', $city)); + // 将每个字符串元素用引号包围,然后用逗号连接起来 + $cityList = "'" . implode("','", $cityArray) . "'"; + $sql .= "and vci.cii2_name in ($cityList) "; + } + + $sql .=" and TAI_GRI_SN in ( select coli_gri_sn from ConfirmLineInfo + where COLI_OPI_ID in ( select OPI_SN from OperatorInfo where OPI_DEI_SN=18) + and COLI_GRI_SN>'' and isnull(DeleteFlag,0)=0 ) + order by tai_getdate desc"; + + // echo ($sql); + // die(); + $feedback_query = + $this->HT->query($sql, array($top)); + + $feedback_result = $feedback_query->result(); + $feedback_list = []; + $customer_id_list = []; + + foreach ($feedback_result as $feedback_row) { + $createdOn = new DateTime($feedback_row->tai_getdate); + $createdOnString = $createdOn->format('M Y'); + + if (!in_array($feedback_row->tai_customerid, $customer_id_list)) { + $feedback = [ + 'title' => $feedback_row->tai_title, + 'customer' => $feedback_row->tai_customerid, + 'content' => $feedback_row->tad_content, + 'url' => $feedback_row->tai_url, + 'createdOn' => $createdOnString + ]; + $feedback_list[] = $feedback; + $customer_id_list[] = $feedback_row->tai_customerid; + } + } + + return $feedback_list; + } } diff --git a/application/views/mobile_first/chinatravel-feedback-list.php b/application/views/mobile_first/chinatravel-feedback-list.php new file mode 100644 index 00000000..6b0870d2 --- /dev/null +++ b/application/views/mobile_first/chinatravel-feedback-list.php @@ -0,0 +1,17 @@ + +
+
+ $feedback) {?> +
+

+

+
+

more

+

+

+
+
+ +
+
+
\ No newline at end of file From b69021d34d56b4b5b93452beb888ce9d94e7bab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Tue, 24 Sep 2024 11:43:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?CT=E7=AB=99Ta=E5=86=85=E5=AE=B9=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/views/mobile_first/chinatravel-feedback-list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/mobile_first/chinatravel-feedback-list.php b/application/views/mobile_first/chinatravel-feedback-list.php index 6b0870d2..54f7e3bf 100644 --- a/application/views/mobile_first/chinatravel-feedback-list.php +++ b/application/views/mobile_first/chinatravel-feedback-list.php @@ -4,7 +4,7 @@ $feedback) {?>

-

+