selectcount(*) as aggregate from `posts` whereexists (select*from `countries` innerjoin `post_target_countries` on `countries`.`id` = `post_target_countries`.`country_id` where `posts`.`id` = `post_target_countries`.`post_id` and `countries`.`id` =13) and `country_id` !=13and `country_id` ='7'and (`posts`.`sys_status` =1and `posts`.`status` ='enabled') and `iskan_project_id` isnulland `ad_type` in (1, 2, 3, 4) and `city_id` ='615'and (`region_id` in ('11442') orexists (select*from `regions` innerjoin `post_regions` on `regions`.`id` = `post_regions`.`region_id` where `posts`.`id` = `post_regions`.`post_id` and `regions`.`id` in ('11442'))) and `posts`.`city_id` ='615'and `posts`.`city_id` ='615'and `posts`.`region_id` in ('11442') and `posts`.`deleted_at` isnullandexists (select*from `users` where `posts`.`user_id` = `users`.`id`) and `posts`.`user_id` !=5716
select `regions`.`ar_name` as `name`, `regions`.`id`, `post_regions`.`post_id` as `pivot_post_id`, `post_regions`.`region_id` as `pivot_region_id` from `regions` innerjoin `post_regions` on `regions`.`id` = `post_regions`.`region_id` where `post_regions`.`post_id` in (85, 1394, 2284, 3817, 3896, 5902, 8355, 21937, 22157, 22580, 23956, 24582)