Skip to content

Commit

Permalink
toArray支持仅返回fields指定字段
Browse files Browse the repository at this point in the history
  • Loading branch information
kiss291323003 committed Aug 21, 2024
1 parent 065f4ab commit 11140bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/AbstractInterface/AbstractEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ function toArray(bool $filterNull = false):array
}

$fields = $this->queryLimit()->getFields();
if(!empty($fields)){
if(!empty($fields['fields'])){
$fields = $fields['fields'];
foreach ($temp as $key => $val){
if(!in_array($key,$fields)){
unset($temp[$key]);
Expand Down

0 comments on commit 11140bd

Please sign in to comment.