mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-13 04:38:03 +08:00
Merge branch 'master' of git://github.com/yiisoft/yii2
This commit is contained in:
@@ -72,7 +72,13 @@ class <?= $searchModelClass ?> extends Model
|
||||
|
||||
protected function addCondition($query, $attribute, $partialMatch = false)
|
||||
{
|
||||
$value = $this->$attribute;
|
||||
if (($pos = strrpos($attribute, '.')) !== false) {
|
||||
$modelAttribute = substr($attribute, $pos + 1);
|
||||
} else {
|
||||
$modelAttribute = $attribute;
|
||||
}
|
||||
|
||||
$value = $this->$modelAttribute;
|
||||
if (trim($value) === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user