我正在熟悉 Fat Free Framework。我正在尝试查询数据库并以 json 格式返回结果。
$user=new DB\SQL\Mapper($db,'wilt');
$filter = array();
$option = array(
'order' => 'created DESC',
'limit' => 7
);
$list=$user->find($filter,$option);
echo json_encode($list);
当我使用 $list=$user->find($filter,$option); 时,它返回 3 个空记录。当我使用 $list=$user->cast() 时,它返回带有字段的一条记录,但值为空。
如何结合查找和投射?