改进属性过滤输出

This commit is contained in:
yunwuxin
2016-07-11 11:35:41 +08:00
parent e1406b969b
commit 6349adf19d
3 changed files with 37 additions and 26 deletions

View File

@@ -51,7 +51,7 @@ class Collection extends \think\Collection
return $this->paginator;
}
public function toArray($allow = [])
public function toArray()
{
if ($this->paginator) {
try {
@@ -64,10 +64,10 @@ class Collection extends \think\Collection
'total' => $total,
'per_page' => $this->listRows(),
'current_page' => $this->currentPage(),
'data' => parent::toArray($allow)
'data' => parent::toArray()
];
} else {
return parent::toArray($allow);
return parent::toArray();
}
}