I need to add some custom values in setOrder() of a collection, but it is not working.
$collection->setOrder("((lat - ".$lat.")*(lat - ".$lat.")) + ((lng - ".$lng.")*(lng - ".$lng."))", 'ASC');
The final part of my collection query like this:
ORDER BY ((lat - -34.9226513)*(lat - -34.9226513)) + ((lng - 138.6094486)*(lng - 138.6094486)) ASC
Please help anybody. Thanks in advance.