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` ='626'and (`region_id` in ('11572') 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 ('11572'))) and `posts`.`city_id` ='626'and `posts`.`city_id` ='626'and `posts`.`region_id` in ('11572') 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 (238, 513, 1179, 2921, 3184, 5468, 5532, 7761, 8925, 10048, 23105, 23774)