Skip to content

Commit

Permalink
Added table alias for fields search
Browse files Browse the repository at this point in the history
  • Loading branch information
execut committed Aug 2, 2018
1 parent 25dfe3b commit cb9999e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fields/Field.php
Expand Up @@ -253,7 +253,7 @@ public function applyScopes(ActiveQuery $query) {

if (!empty($value) || $value === '0') {
$query->andFilterWhere([
$attribute => $value,
$this->model->tableName() . '.' . $attribute => $value,
]);
}
}
Expand Down
4 changes: 4 additions & 0 deletions fields/HasOneRadioList.php
Expand Up @@ -25,6 +25,10 @@ class HasOneRadioList extends HasOneSelect2
public $widgetOptions = [];
public $fieldWidgetOptions = [];
public function getField() {
if ($this->_field === false) {
return false;
}

$data = $this->getRelationObject()->getData(true);
unset($data['']);
if (empty($data)) {
Expand Down

0 comments on commit cb9999e

Please sign in to comment.