Answer the question
In order to leave comments, you need to log in
Yii how to organize like type search?
How to modify standard search so that it can search in string
1,2,3 for something like like 2,3 or 2 or 1,3 ? in general, it would be ideal to suggest how to make a search based on the checkboxlist. well, we select the 1.3 element and, based on it, we do a search.
---
some kind of bug
$criteria->addSearchCondition('m_complect',$this->m_complect,true, 'LIKE');
fails with value 1,3,6 search 1,6
need query like FROM
`tbl_motor`
where `m_complect` like '%1%6%';
and it does
`tbl_motor`
where `m_complect` like '%1.6%';
and if you change it like that, then it's not right at all
$criteria->addSearchCondition('m_complect',str_replace(",", "%", $this->m_complect),true, 'LIKE');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question