Skip to content

Commit c0103f4

Browse files
author
Liukshyn Roman
committed
MAGETWO-45447: SQL error after search in Billing Agreements grid in Admin
- Fixed applying filter for created_at and updated_at fields
1 parent 9b314ba commit c0103f4

File tree

1 file changed

+13
-0
lines changed
  • app/code/Magento/Paypal/Model/ResourceModel/Billing/Agreement

1 file changed

+13
-0
lines changed

app/code/Magento/Paypal/Model/ResourceModel/Billing/Agreement/Collection.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,17 @@ public function addCustomerDetails()
9090
);
9191
return $this;
9292
}
93+
94+
/**
95+
* @param array|string $field
96+
* @param null|string|array $condition
97+
* @return $this
98+
*/
99+
public function addFieldToFilter($field, $condition = null)
100+
{
101+
if (in_array($field , ['created_at', 'updated_at'])) {
102+
$field = 'main_table.' .$field;
103+
}
104+
return parent::addFieldToFilter($field, $condition); // TODO: Change the autogenerated stub
105+
}
93106
}

0 commit comments

Comments
 (0)