got a select that does 10 query in doctrine (Symfony)

半世苍凉 提交于 2019-12-02 13:04:53

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.*')

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!