500

Internal Server Error

SQLSTATE[HY000]: General error: 1210 Incorrect arguments to st_distance_sphere (SQL: select count(*) as aggregate from (select `posts`.`id`, `country_code`, `category_id`, `post_type_id`, `title`, `posts`.`price`, `city_id`, `featured`, `posts`.`created_at`, `reviewed`, `verified_email`, `verified_phone`, (posts.price * 1) AS calculatedPrice, tPackage.lft, (ST_Distance_Sphere(POINT(lon, lat), POINT(-999999, -999999)) / 1000) AS distance from `posts` left join (select MAX(lp.id) as lpId, `lp`.`post_id` from `payments` as `lp` where `lp`.`active` = 1 group by `lp`.`post_id`) as `tmpLp` on `tmpLp`.`post_id` = `posts`.`id` and `featured` = 1 left join `payments` as `latestPayment` on `latestPayment`.`id` = `tmpLp`.`lpId` left join `packages` as `tPackage` on `tPackage`.`id` = `latestPayment`.`package_id` where exists (select * from `categories` where `posts`.`category_id` = `categories`.`id` and `active` = 1) and exists (select * from `cities` where `posts`.`city_id` = `cities`.`id` and `active` = 1) and `country_code` = IN and (`verified_email` = 1 and `verified_phone` = 1) and `reviewed` = 1 and `archived` = 0 and `reviewed` = 1 and `verified_email` = 1 and `verified_phone` = 1 and `reviewed` = 1 group by posts.id having distance <= 50) as `aggregate_table`)