请问大家
findallbyattributes 如何用cpage分页呢?
请问大家
findallbyattributes 如何用cpage分页呢?
和findAll()一样啊:findAllByAttributes($attributes, $criteria)
可是强哥,count怎么办呢?得到的页数没法用findAllByAttributes啊?
可以的啊,$criteria不是可以设置limit和offset么?
Criteria可以有以下属性的:
condition:string query condition.
distinct:boolean whether to select distinct rows of data only.
group:string how to group the query results.
having:string the condition to be applied with GROUP-BY clause.
join:string how to join with other tables.
limit:integer maximum number of records to be returned.
offset:integer zero-based offset from where the records are to be returned.
order:string how to sort the query results.
params:array list of query parameter values indexed by parameter placeholders.
select:mixed the columns being selected.