phalapi查询问题。

刚接触phalapi,已经装好了。

想问问,我自有的mysql数据库,如何查询返回json,并可以分页及指定ID查询、还有签名验证。

已经在dbs.php设置好了数据库相关信息。

希望能贴上所有的代码,及告知放在哪里。

 

这样查询,望采纳,谢谢

/**
 * 查询
 * @return array data 结果集
 */
public function select(){
    $data   = array();
    $data[] = DI()->notorm->user->select('name,phone')->where('id', $this->id)->fetch();
    $data[] = DI()->notorm->user->select('name,phone')->where('id = ?', $this->id)->fetchAll();
    $data[] = DI()->notorm->user->select('name,phone')->where('id != ?', $this->id)->fetchRows();
    return $data;
}