Browse Source

Merge pull request #2504 from thiagotalma/master

Allow add a condition telling the table to avoid ambiguity error.
tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
73a15c2bbf
  1. 8
      extensions/gii/generators/crud/templates/search.php

8
extensions/gii/generators/crud/templates/search.php

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

Loading…
Cancel
Save