diff --git a/app/api/controller/IndexController.php b/app/api/controller/IndexController.php index afd5dd81..aa9a1073 100644 --- a/app/api/controller/IndexController.php +++ b/app/api/controller/IndexController.php @@ -70,8 +70,8 @@ class IndexController extends BaseApiController 'create_time' => $landCollection['create_time'] ]; $monitorThreshold = MonitorThreshold::select(); - if($monitorThreshold){ - $monitorThreshold=$monitorThreshold->toArray()[0]; + if($monitorThreshold->toArray()!=null){ + $monitorThreshold=$monitorThreshold[0]; }else{ $monitorThreshold=[]; }