Merge branch 'master' of git://github.com/yiisoft/yii2

This commit is contained in:
Qiang Xue
2014-02-23 19:12:38 -05:00

View File

@@ -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;
}