evan108108 / RESTFullYii

RESTFull API for your Yii application

Home Page:http://evan108108.github.com/RESTFullYii/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Apply filter on two relative tables

talhakazmi opened this issue · comments

I have a table structure of friends, i have applied a filter
[{"property":"user_id","value":"x","operator":"="},{"property":"friends.friend_id","value":"x","operator":"="}]

This makes the query with AND in between these two conditions i need OR in between these two conditions. I have tried ANDOR but this works when conditions are for the same table.

Please help me out.

Still couldn't find any solution, any one can help is this regard.

@talhakazmi : Just use the "andor" filter property:

http://api/post?filter=[{"property":"author_id", "value":3, "operator":"=", "andor":"or"}, {"property":"author_id", "value":2, "operator":"=", "andor":"or"}]