CakePHP - Paginate / Query: find lowest of multiple fields & order by it
- by Atea
I am using CakePHP for a price-comparison website.
I have a table products with fields: id, pride_regular, price_action.
I would like to combine the fields price_regular and price_action into a dynamic field: price. The lowest value of these two fields should be the value of the new price field. Also I want to order on it Ascending.
Should I use a custom MySQL-query?