0

I'm currently Facing a really strange Issue I'm applying filter on my custom table data in grid by adding function

Vendor/Module/Model/ResourceModel/Withdrawal/Grid/Collection.php

protected function _renderFiltersBefore() {
        $id = (int)$this->request->getParam('id');
        // echo $id;
        // print_r($id);exit;
        $this->getSelect()->where('main_table.seller_id ='. $id);
        parent::_renderFiltersBefore();
    }

Now the filter is working Fine when I apply the value Hard coded... like $this->getSelect()->where('main_table.seller_id = 2'); it works fine even if I assign variable a hard coded value like $id=2 then it also works fine... but when I get the value by Param then it do not return any data while as you can see in my code that I've echo the ID n it is returning the proper value but when I assign it to Query then it is not working... what is the issue n how to sort this thanks.

2
  • I think it's something to do with the data types of both, seller_id and the $id you get through request->param(). – Abdul Samad Abbasi Jan 22 at 12:08
  • at first I was thinking the same but then I compare these with === in if condition thats why I've assigned the int in my Param coz at int they were same – Asad Khan Jan 22 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.