select `departments`.*, `ser_roomsable`.`ser_rooms_id` as `pivot_ser_rooms_id`, `ser_roomsable`.`department_id` as `pivot_department_id`, `ser_roomsable`.`ser_rooms_type` as `pivot_ser_rooms_type` from `departments` innerjoin `ser_roomsable` on `departments`.`id` = `ser_roomsable`.`department_id` where `ser_roomsable`.`ser_rooms_id` =1and `ser_roomsable`.`ser_rooms_type` ='App\Models\SerminarRoom'
select `members`.*, `same_authorsables`.`same_authors_id` as `pivot_same_authors_id`, `same_authorsables`.`members_id` as `pivot_members_id`, `same_authorsables`.`same_authors_type` as `pivot_same_authors_type` from `members` innerjoin `same_authorsables` on `members`.`id` = `same_authorsables`.`members_id` where `same_authorsables`.`same_authors_id` in (1129, 1130, 1131) and `same_authorsables`.`same_authors_type` ='App\Models\Prints'