OmgDef/yii2-multilingual-behavior

How to use "with" active query?

Closed this issue · 2 comments

eg:
SELECT * FROM post_lang WHERE (language='ru') AND post_id IN (1,2,3)

Very many queries to the database. How to fix it ?

@onskyD @shoxabbos

Product::find()->localized()->all() 

Generates this

SELECT * FROM `product_translation` WHERE (`language`='ru') AND (`owner_id` IN (5923, 5922, 5916, 5932))