Commit 73a15c2b by Qiang Xue

Merge pull request #2504 from thiagotalma/master

Allow add a condition telling the table to avoid ambiguity error.
parents ba2c35b8 ba9f5d65
...@@ -72,7 +72,13 @@ class <?= $searchModelClass ?> extends Model ...@@ -72,7 +72,13 @@ class <?= $searchModelClass ?> extends Model
protected function addCondition($query, $attribute, $partialMatch = false) 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) === '') { if (trim($value) === '') {
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment