A
A
Antago2014-09-10 19:42:49
Yii
Antago, 2014-09-10 19:42:49

Yii2 how to filter records on Many to Many relationship?

There are three tables: categories, products and linking them (because a product can have several categories).
There is a page that displays all-all products and a filter by category. In this case, several categories can be selected in the filter at once.
If there was only one category in the filter, then the selection of goods would be decided by a regular getter with hasMany viaTable. How to select products from several categories at once?
PS I would like to solve the problem using AR Yii2 wrappers, and not on pure sql, because the filter is large and there are many other parameters.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Kravchuk, 2017-02-17
@TaPTaK1989

there will be no answer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question