I spent too much time investigating this problem. I have a table structure sth like this:
Table 1:
Shops
------
id
name
etc..
Table 2:
Days
-----
id
name
shop_id
etc...
Table 3:
Incomes
--------
id
day_id
etc...
I need to get the day objects, including the related income objects like this:
{
id:1
name:"2018-10-16"
incomes:[ income objects... ]
}
I also need to filter these by table days
' fields and also by table incomes
' fields. So finally I only need those day objects with only those income objects where all the condition is okay.
I'm really confused, so sorry if it's not understandable.