SQL Error


Code error: 42S22.

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'posts.id DESC' in 'order clause' (SQL: select DISTINCT posts.id, country_code, category_id, post_type_id, title, posts.price, city_id, featured, posts.created_at, reviewed, verified_email, verified_phone, (select lft from packages as tPackage where tPackage.id = (select MAX(lp.package_id) from payments as lp where lp.active = 1 and lp.post_id = id) limit 1) as lft, (posts.price * 1) AS calculatedPrice, packages.price AS packagePrice from `posts` inner join `payments` on `payments`.`post_id` = `posts`.`id` inner join `packages` on `packages`.`id` = `payments`.`package_id` where `city_id` = 12044 and archived = 0 and verified_email = 1 and verified_phone = 1 and exists (select MAX(lp.id) from payments as lp where lp.active = 1 and lp.post_id = id) and exists (select categories.id from categories where category_id = categories.id and active = 1) and exists (select cities.id from cities where city_id = cities.id and cities.active = 1) and `archived` = 0 and `archived_at` is null and `verified_email` = 1 and `verified_phone` = 1 order by `posts`.`id DESC` asc, `featured` desc, `packagePrice` desc limit 12 offset 0)