From ff26e35126a1e7fbd082e18a9d62c9e85e9ebcfa Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Wed, 27 Dec 2023 10:17:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=9F=8E=E5=B8=82?= =?UTF-8?q?=E5=8F=8D=E9=A6=88=E6=A0=87=E7=AD=BE=E9=87=8D=E5=A4=8D=E6=A0=87?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/models/feedback_model.php | 23 +++++++++++-------- .../mobile_first/ah-feedback-30-list.php | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/application/models/feedback_model.php b/application/models/feedback_model.php index 6cbc5639..f7dcae9f 100644 --- a/application/models/feedback_model.php +++ b/application/models/feedback_model.php @@ -179,20 +179,23 @@ class Feedback_model extends CI_Model { $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'); - $feedback_count = COUNT($feedback_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; + + 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/ah-feedback-30-list.php b/application/views/mobile_first/ah-feedback-30-list.php index 59ce6ce4..c1b2b162 100644 --- a/application/views/mobile_first/ah-feedback-30-list.php +++ b/application/views/mobile_first/ah-feedback-30-list.php @@ -4,7 +4,7 @@

More -
,
+
From 0e8ade5c24e8e5596ea72f5e768f64405cea8265 Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Wed, 27 Dec 2023 10:45:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=A2=E4=BA=BAID=E5=92=8C=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E5=A2=9E=E5=8A=A0=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/mobile_first/ah-feedback-city-list.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/application/views/mobile_first/ah-feedback-city-list.php b/application/views/mobile_first/ah-feedback-city-list.php index eedbad23..05602746 100644 --- a/application/views/mobile_first/ah-feedback-city-list.php +++ b/application/views/mobile_first/ah-feedback-city-list.php @@ -8,7 +8,7 @@

More -
,
+
@@ -22,7 +22,7 @@

More -
,
+
@@ -36,7 +36,7 @@

More -
,
+
@@ -50,7 +50,7 @@

More -
,
+
@@ -64,7 +64,7 @@

More -
,
+
@@ -79,7 +79,7 @@

More -
,
+
@@ -93,7 +93,7 @@

More -
,
+
\ No newline at end of file