获取列表

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

    原文: http://doc.cmlphp.com/devintro/model/mysql/fastmethod/getlist.html