获取列表
//相当于$this->mapDbAndTable()->orderBy('id', 'desc')->orderBy('sort', 'asc')->select(0, 10);
$this->getList(0, 10, array('id' => 'desc', 'sort' => 'asc'), 'users', 'u_');
//手动传入表名,且特殊指定表前缀v2.6.5起可用
//在xxModel中
$this->db()->where('id', 1)->whereGt('status', 1);//会将where条件注入到orm
$this->where('id', 1)->whereGt('status', 1)//这边操作的是orm下db类的方法
->getList(0, 10, 'DESC'); //这边操作的是model的方法
//要注意的是在Model中的getList()会自动调用$this->db()->table()所以在设置where条件时不能再调用$this->db()->table()。否则会造成sql出错。
原文: http://doc.cmlphp.com/devintro/model/mysql/fastmethod/getlist.html