製品とコメントの 2 つのテーブルがあります。
DQL / symfony を使用してクエリを作成しようとしています。
通常、私はそのようなことをすることができます:
// Get number of comment not visited per product
Select count (p.id) from Product p, Comment c where P.id = c.p_id and c.status = 0;
// Get number of comment read visited per product
Select count (p.id) from Product p, Comment c where P.id = c.p_id and c.status = 1;
ただし、ページネーションバンドルを使用している間、パラメーターにクエリを1つだけ渡す必要があります(フィルターバンドルも使用しているように、フィルターを適用できるようにクエリを1つだけ持つ必要があります)。
何か案が!!