exclusive where
Hi, certainly miss understood. I just try to get POSTS with PROMOTION, so excluding POST without Promotion, as i do with a basic sql query (SELECT * FROM posts INNER JOIN promotions ON posts.id=promotions.postid WHERE promotion = 'active')
Having two tables with a one to one relation.
$this->posts->with_promotions('where:promotion='active')->limit(10)->get_all();
MY_MODEL do 2 queries, first getting 10 posts and then get promotions and merge.
Sure I'm not in the right way to do this but i can't find how.
thanks
i don't understand the issue...
Sorry. i just want to exclude posts without promotion relation; Depending on promotion status or not, but with the method i always get posts, even when no promotion in the relation. ex. if i have 10 posts, but only 2 with promotion, result must have only two records objects, not Ten.