There are two tables, album(id, atitle, collect) and photo(id, ftitle, status) .

An album can store several photos, and the same photo can belong to several albums at the same time. Also, the photo table has a status field; if it is 1, then the photo is visible, if 0 is not visible.
The collet field will contain an array of id photos in the album (by the way, is this a good choice or is it better to make a link in the tables?).

Tell me how to make a request to yii2 correctly in order to display a list of albums, in each of which all photos have status 1 ?

  • What does yii have to do with it, just write a SQL request for you? - Kromster
  • I want to see exactly how such requests are made in yii2. Here the question is even more in the organization itself: is it better to make the tables linked by a spring key or simply to save an array in the collect field and then check it with it - ZaurK

0