Making a (readonly) Repeater with a custom query
So I am making a system for making schedules(=Schedules) for employees and manage their vacations (=Absences). Users are added to the schedules with a pivot table (schedule_user). Now I am trying to make something like the pictures and I am almost there!
What I want is that if you select the user/start_Date/end_date that it automaticly looks up all the conflicting schedules and counts the hours. The overview I want to display in a simple TableRepeater. This is the code I now have:
This results in the following query that I intercepted with debugbar:
This query returns null because of this part: "
schedule_user
.user_id
is null and schedule_user
.user_id
is not null and". If you would delete that part the query would work perfectly. My question is, why is this added to the query?

1 Reply
I guess it has sth to do with the relationship that is set up as follows:
But how can I "unset" the previous scope? Or is it possible to initate the Repeater form on a custom query? I read the docs 3 times over now, I just can't figure it out. Thanks a lot for reading this far.