ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: queensgambit9 on March 17, 2021, 03:35:40 pm
-
Hi
For contain condition would it be possible to use keywords to split string to multiple search terms?
Ex:
term1+term2+term3 generates (PHP) query to DB:
...WHERE a LIKE '%term1%' AND a LIKE '%term2%' AND a LIKE '%term3%'
instead of
...WHERE a LIKE '%term1+term2+term3%'
-
yes it's possible to do so by updating FilterHelper::_contain method in PHP code.
public static function _contain($dataIndx, &$fcrule, &$param, $value){
$_fcrule = array();
$arr = explode("+", $value);
foreach ($arr as $val) {
$_fcrule[] = $dataIndx . " like CONCAT('%', ?, '%')";
$param[] = $val;
}
$fcrule[] = implode(" AND ", $_fcrule);
}