From ee3c869d716fbdba69e2bd1d88885d5d56ef5a5a Mon Sep 17 00:00:00 2001 From: dongpd Date: Wed, 9 Dec 2020 11:12:13 +0700 Subject: [PATCH] check delete list management --- helpers/CaptureLogsGrid.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/helpers/CaptureLogsGrid.php b/helpers/CaptureLogsGrid.php index 6661c500..5dbbd72d 100644 --- a/helpers/CaptureLogsGrid.php +++ b/helpers/CaptureLogsGrid.php @@ -65,18 +65,23 @@ class CaptureLogsGrid { public static function birthday() { return function($model) { $staff = $model->listManagement; - return date("d/m/Y", $staff->birthday); + if ($staff) + return date("d/m/Y", $staff->birthday); + return ""; }; } public static function registrationImage() { return function($model) { $staff = $model->listManagement; - $images = json_decode($staff->image, true); - return Html::img("/data/uploads/face/" . $images[0]['url'], [ - "class" => "img-thumbnail", - "style" => "width: 150px;height:150px;" - ]); + if ($staff) { + $images = json_decode($staff->image, true); + return Html::img("/data/uploads/face/" . $images[0]['url'], [ + "class" => "img-thumbnail", + "style" => "width: 150px;height:150px;" + ]); + } + return ""; }; }