From c15317f1815719c2a1e52b21ec316f419c972eb1 Mon Sep 17 00:00:00 2001 From: Jimmy Liow <18777396951@163.com> Date: Tue, 13 Jun 2023 10:18:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E7=B1=BB=E5=88=AB=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E6=8E=A8=E8=8D=90=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/information.php | 32 ++++++++++++++++--------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/application/controllers/information.php b/application/controllers/information.php index ce8fcca1..5d6dec11 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -988,21 +988,31 @@ class Information extends CI_Controller $information = $this->Information_model->Detail($this->input->get('is_id')); $recommand_information = $this->recommand_information($information); var_dump($recommand_information); - $tipsRightList = []; - for ($i=1; $i <= 36; $i++) { - $key = 'List Tips Right '.$i; + $tips_right_first = []; + $tips_right_second = []; + $tips_right_third = []; + for ($i=1; $i <= 12; $i++) { + $key = 'List Tips Right A_'.$i; if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) { - $tipsRightList[] = $recommand_information[$key]; + $tips_right_first[] = $recommand_information[$key]; + } + } + for ($i=1; $i <= 12; $i++) { + $key = 'List Tips Right B_'.$i; + if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) { + $tips_right_second[] = $recommand_information[$key]; + } + } + for ($i=1; $i <= 12; $i++) { + $key = 'List Tips Right C_'.$i; + if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) { + $tips_right_third[] = $recommand_information[$key]; } } - $firstList = array_slice($tipsRightList, 0, 12); - $secondList = array_slice($tipsRightList, 12, 12); - $thirdList = array_slice($tipsRightList, 24, 12); - echo 'COUNT: '.COUNT($tipsRightList); - echo '; 1 COUNT: '.COUNT($firstList); - echo '; 2 COUNT: '.COUNT($secondList); - echo '; 3 COUNT: '.COUNT($thirdList); + echo 'List Tips Right A: '.COUNT($tips_right_first); + echo '; List Tips Right B: '.COUNT($tips_right_second); + echo '; List Tips Right C: '.COUNT($tips_right_third); $tips_right_list_content = $this->load->view( 'mobile_first/ah-tips-right-list',