toArray() 转换为数组,hidden()不输出的字段
public function index(){
$user = model('User');
$data = $user::get()->hidden(['name'])->toArray();
}
toJson()转换为json,visible() 输出的字段
public function index(){
$user = model('User');
$data = $user::get()->visible(['name','update_time'])->toJson();
}
但是都只适合单个查询