Closed thejaydev closed 1 year ago
Hey @jaydev-01 . Please read documentation in the filters section. You can define custom filters by multiple entities in the case you have many joins. In your case you can try to use sqlAlias as the parameter of @filter decorator. The same thing works for the sorting. When you're creating query builder pass the same alias so filter's sql alias would match what you pass to query builder.
Thank you for your help @Adrinalin4ik
Sure, no problem. Don't hesitate to ask me any questions.
Describe the bug Suppose we have tree table product, category, and product type tables in all three tables containing field name status. So while I fetch products with category and product type using setFindOption with relation category and product type and apply filter. In this case, if the user tries to fetch the products by status using a filter they got the error of column status is ambiguous. The reason behind this error is that filter variables do not attach any table preference in query building so that is why the SQL database cause an error.