Skip to content

Commit 0c78e3f

Browse files
author
Alexander.L
committed
Расширение функционала фильтра колонок в Column filter.
1 parent 51e4253 commit 0c78e3f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Grid/Column/HasHeader.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ protected function addFilter($type = null, $formal = null)
8181
$type = 'equal';
8282
}
8383

84-
if (in_array($type, ['equal', 'like', 'date', 'time', 'datetime'])) {
84+
if (in_array($type, ['equal', 'like', 'ilike', 'date', 'time', 'datetime'])) {
8585
return $this->addHeader(new InputFilter($type));
8686
}
8787

src/Grid/Column/InputFilter.php

+6
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ public function addBinding($value, Model $model)
4242
return;
4343
}
4444

45+
if ($this->type == 'ilike') {
46+
$model->where($this->getColumnName(), 'ilike', "%{$value}%");
47+
48+
return;
49+
}
50+
4551
if (in_array($this->type, ['date', 'time'])) {
4652
$method = 'where'.ucfirst($this->type);
4753
$model->{$method}($this->getColumnName(), $value);

0 commit comments

Comments
 (0)