I have noticed that if you build a query with the query builder deleted=0 gets automatically added to the initial select table, but all the other joins need to include 'x.deleted'=>0 in the ->where
For a left join you have to add it into the join criteria like SQL
->leftJoin('MyTable','mt',['mt.id:'=>'ot.myTableId,'mt.deleted'=>false]
just an FYI as I had some incorrect results until I spotted this.
For a left join you have to add it into the join criteria like SQL
->leftJoin('MyTable','mt',['mt.id:'=>'ot.myTableId,'mt.deleted'=>false]
just an FYI as I had some incorrect results until I spotted this.
Comment