Skip to content

Commit 0ff4da0

Browse files
committed
Better find logic for strings
1 parent faa14e1 commit 0ff4da0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PHPFUI/ORM/Table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function addFind(array $parameters) : \PHPFUI\ORM\DataObjectCursor
6969
}
7070
$type = $fields[$baseField][\PHPFUI\ORM\Record::PHP_TYPE_INDEX] ?? 'string';
7171

72-
if (\in_array($type, ['int', 'float', 'string', 'timestamp']))
72+
if (\in_array($type, ['int', 'float', 'timestamp']))
7373
{
7474
if ($direction)
7575
{
@@ -82,7 +82,7 @@ public function addFind(array $parameters) : \PHPFUI\ORM\DataObjectCursor
8282
}
8383
elseif ('string' == $type && $value)
8484
{
85-
$condition->and($baseField, '%' . $parameters[$field] . '%', new \PHPFUI\ORM\Operator\Like());
85+
$condition->and($baseField, '%' . $value . '%', new \PHPFUI\ORM\Operator\Like());
8686
}
8787
}
8888
$this->setWhere($condition);

0 commit comments

Comments
 (0)