select `members`.*, `academic_ranks`.`name` as `acadename`, `degrees`.`name` as `degreesname` from `members` leftjoin `academic_ranks` on `members`.`academic_ranks` = `academic_ranks`.`id` leftjoin `degrees` on `members`.`degree` = `degrees`.`id` innerjoin `office_staffs` on `members`.`id` = `office_staffs`.`member_id` where `office_staffs`.`department_id` =13and `members`.`status` =1orderby `office_staffs`.`order` asc
select `members`.*, `academic_ranks`.`name` as `acadename`, `degrees`.`name` as `degreesname` from `members` leftjoin `academic_ranks` on `members`.`academic_ranks` = `academic_ranks`.`id` leftjoin `degrees` on `members`.`degree` = `degrees`.`id` innerjoin `office_staffs` on `members`.`id` = `office_staffs`.`member_id` where `office_staffs`.`department_id` =13and `members`.`status` in (3, 4) orderby `office_staffs`.`order` asc
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 (1134, 1135, 1137) and `same_authorsables`.`same_authors_type` ='App\Models\Prints'