File tree Expand file tree Collapse file tree 1 file changed +2
-26
lines changed Expand file tree Collapse file tree 1 file changed +2
-26
lines changed Original file line number Diff line number Diff line change @@ -168,32 +168,8 @@ public function split(){
168168 private function format ($ value ) {
169169 $ queryString = "" ;
170170 foreach ($ this ->paramArray as $ col ){
171- switch ($ this ->operators ){
172- case self ::START_WITH_QUERY :
173- $ queryString .= $ col . " {$ this ->queryStart } ' {$ value }%' {$ this ->queryEnd } " ;
174- break ;
175- case self ::END_WITH_QUERY :
176- $ queryString .= $ col . " {$ this ->queryStart } '% {$ value }' {$ this ->queryEnd } " ;
177- break ;
178- case self ::HAVE_ANY_QUERY :
179- $ queryString .= $ col . " {$ this ->queryStart } '% {$ value }%' {$ this ->queryEnd } " ;
180- break ;
181- case self ::HAVE_SECOND_QUERY :
182- $ queryString .= $ col . " {$ this ->queryStart } '_ {$ value }%' {$ this ->queryEnd } " ;
183- break ;
184- case self ::START_WITH_QUERY_2LENGTH :
185- $ queryString .= $ col . " {$ this ->queryStart } ' {$ value }_%' {$ this ->queryEnd } " ;
186- break ;
187- case self ::START_WITH_QUERY_3LENGTH :
188- $ queryString .= $ col . " {$ this ->queryStart } ' {$ value }__%' {$ this ->queryEnd } " ;
189- break ;
190- case self ::START_END_WITH_QUERY :
191- $ queryString .= $ col . " {$ this ->queryStart } ' {$ value }% {$ value }' {$ this ->queryEnd } " ;
192- break ;
193- default :
194- $ queryString .= $ col . " {$ this ->queryStart } '% {$ value }%' {$ this ->queryEnd } " ;
195- break ;
196- }
171+ $ sqlQuery = str_replace ("query " , $ value , $ this ->operators );
172+ $ queryString .= $ col . " {$ this ->queryStart } ' {$ sqlQuery }' {$ this ->queryEnd } " ;
197173 }
198174 return $ queryString ;
199175 }
You can’t perform that action at this time.
0 commit comments