SQL Error


Code error: 42S22.

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'reviewed' in 'field list' (SQL: select count(*) as aggregate from (select `32posts`.`id`, `country_code`, `category_id`, `post_type_id`, `title`, `32posts`.`price`, `city_id`, `featured`, `32posts`.`created_at`, `reviewed`, `verified_email`, `verified_phone`, `tags`, (32posts.price * 1) AS calculatedPrice, 32tPackage.lft, (6371 * 2 * ATAN2(SQRT(SIN(RADIANS(Y(POINT(-71.45, 19.74)) - Y(POINT(lon, lat)))/2) * SIN(RADIANS(Y(POINT(-71.45, 19.74)) - Y(POINT(lon, lat)))/2) + COS(RADIANS(Y(POINT(lon, lat)))) * COS(RADIANS(Y(POINT(-71.45, 19.74)))) * SIN(RADIANS(X(POINT(-71.45, 19.74)) - X(POINT(lon, lat)))/2) * SIN(RADIANS(X(POINT(-71.45, 19.74)) - X(POINT(lon, lat)))/2)), SQRT(1-SIN(RADIANS(Y(POINT(-71.45, 19.74)) - Y(POINT(lon, lat)))/2) * SIN(RADIANS(Y(POINT(-71.45, 19.74)) - Y(POINT(lon, lat)))/2) + COS(RADIANS(Y(POINT(lon, lat)))) * COS(RADIANS(Y(POINT(-71.45, 19.74)))) * SIN(RADIANS(X(POINT(-71.45, 19.74)) - X(POINT(lon, lat)))/2) * SIN(RADIANS(X(POINT(-71.45, 19.74)) - X(POINT(lon, lat)))/2)))) AS distance from `32posts` left join (select MAX(32lp.id) as lpId, `32lp`.`post_id` from `32payments` as `32lp` where `32lp`.`active` = 1 group by `32lp`.`post_id`) as `32tmpLp` on `32tmpLp`.`post_id` = `32posts`.`id` and `featured` = 1 left join `32payments` as `32latestPayment` on `32latestPayment`.`id` = `32tmpLp`.`lpId` left join `32packages` as `32tPackage` on `32tPackage`.`id` = `32latestPayment`.`package_id` where exists (select * from `32categories` where `32posts`.`category_id` = `32categories`.`id` and `active` = 1) and exists (select * from `32cities` where `32posts`.`city_id` = `32cities`.`id` and `active` = 1) and `country_code` = DO and (`verified_email` = 1 and `verified_phone` = 1) and `archived` = 0 and `category_id` in (19) and `verified_email` = 1 and `verified_phone` = 1 group by 32posts.id having distance <= 50) as `aggregate_table`)