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` ='614'and (`region_id` in ('11363') 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 ('11363'))) and `posts`.`city_id` ='614'and `posts`.`city_id` ='614'and `posts`.`region_id` in ('11363') 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 (332, 803, 4093, 4271, 4462, 4518, 5469, 7703, 8262, 8688, 8741, 22745)