From c8114e6c92d4441b899c618a4a7ce151b651aed4 Mon Sep 17 00:00:00 2001 From: "monken,wu" <610877102@mail.nknu.edu.tw> Date: Sun, 19 Apr 2020 21:30:45 +0800 Subject: [PATCH] fix orlike --- src/TablesIgniter.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/TablesIgniter.php b/src/TablesIgniter.php index d89be87..a863bb1 100644 --- a/src/TablesIgniter.php +++ b/src/TablesIgniter.php @@ -141,8 +141,12 @@ private function getOutputData($row){ */ private function extraConfig($bui){ if(!empty($_POST["search"]["value"])){ - foreach ($this->searchLike as $field) { - $bui->orLike($field,$_POST["search"]["value"]); + foreach ($this->searchLike as $key => $field) { + if($key == 0){ + $bui->like($field,$_POST["search"]["value"]); + }else{ + $bui->orLike($field,$_POST["search"]["value"]); + } } } if(isset($_POST["order"])){