Skip to content

Commit

Permalink
修正visible方法
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed May 28, 2019
1 parent 9d301c2 commit 05eecd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/think/model/concern/Conversion.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function toArray()
foreach ($data as $key => $val) {
if ($val instanceof Model || $val instanceof ModelCollection) {
// 关联模型对象
if (isset($this->visible[$key])) {
if (isset($this->visible[$key]) && is_array($this->visible[$key])) {
$val->visible($this->visible[$key]);
} elseif (isset($this->hidden[$key]) && is_array($this->hidden[$key])) {
$val->hidden($this->hidden[$key]);
Expand Down

0 comments on commit 05eecd1

Please sign in to comment.