I got a big query that execute 11 query, I didnt know where the problem is, but found the problem was in a select a did for geo loc, anyone has an idea how to correct that?
I would change all where by whereIn like:
if($userid){
$q->andWhereIn('a.userid', $userid);
}
if($catID){
$q->andWhereIn('ca.categorie_id', $catID);
}
I think this happens because when you're using the results in the view the paginator cant fetch all records in a row, so for each item has to do the query to get all fields.
I am really not sure why but here what was the problem:
I used select('a.latitude')
when I should have used...
select('a.*')