Convert SQL query into CakePHP pagination query
How can I use the following query:
SELEC开发者_开发问答T *
FROM `laps`
WHERE `id` = (
SELECT `id`
FROM `laps` AS `alt`
WHERE `alt`.`user_id` = `laps`.`user_id`
ORDER BY `lap_time` ASC
LIMIT 1 )
ORDER BY `lap_time` ASC
in my CakePHP app and paginate the results?
what you actually want is how to do custom pagination query. there's some info about that here
convert your query to join way, then use cake custom pagination.
精彩评论