fix: [CRUD] Correct usage of the `like` condition operator on the query
parent
9a1b38ff5a
commit
697c1ff0a6
|
@ -458,7 +458,9 @@ class CRUDComponent extends Component
|
||||||
if (strlen(trim($value, '%')) === strlen($value)) {
|
if (strlen(trim($value, '%')) === strlen($value)) {
|
||||||
return $query->where([$fieldName => $value]);
|
return $query->where([$fieldName => $value]);
|
||||||
} else {
|
} else {
|
||||||
return $query->like([$fieldName => $value]);
|
return $query->where(function ($exp, \Cake\ORM\Query $q) use ($fieldName, $value) {
|
||||||
|
return $exp->like($fieldName, $value);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue