From e765b6f4351e92eb9c9db8ea634922ad13ec59bd Mon Sep 17 00:00:00 2001 From: weiz <736250432@qq.com> Date: Sat, 20 Jan 2024 11:41:32 +0800 Subject: [PATCH] update --- app/common/model/custom/CustomService.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/common/model/custom/CustomService.php b/app/common/model/custom/CustomService.php index c073f4c98..0c2947962 100644 --- a/app/common/model/custom/CustomService.php +++ b/app/common/model/custom/CustomService.php @@ -33,27 +33,27 @@ class CustomService extends BaseModel public function getDateAttr($value): string { - return empty($value) ? '' : date('Y-m-d', $value); + return !empty($value) ? date('Y-m-d', $value) : ''; } public function getDoneDateAttr($value): string { - return empty($value) ? '' : date('Y-m-d', $value); + return !empty($value) ? date('Y-m-d', $value) : ''; } public function getClassificationTextAttr($value,$data){ - $dictData = DictData::where('type_value','classification')->column('name','value'); - return $dictData[$data['classification']]; + $dict = DictData::where('type_value','classification')->column('name','value'); + return !empty($data['classification']) ? $dict[$data['classification']] : ''; } public function getUrgencyTextAttr($value,$data){ - $dictData = DictData::where('type_value','urgency')->column('name','value'); - return $dictData[$data['urgency']]; + $dict = DictData::where('type_value','urgency')->column('name','value'); + return !empty($data['urgency']) ? $dict[$data['urgency']] : ''; } public function getProcessingResultTextAttr($value,$data){ - $dictData = DictData::where('type_value','custom_service_solv_result')->column('name','value'); - return $dictData[$data['processing_result']]; + $dict = DictData::where('type_value','custom_service_solv_result')->column('name','value'); + return !empty($data['processing_result']) ? $dict[$data['processing_result']] : ''; } public function getIsSolveTextAttr($value,$data): string @@ -64,7 +64,7 @@ class CustomService extends BaseModel public function getAnnexAttr($value) { - return empty($value) ? null : json_decode($value,true); + return !empty($value) ? json_decode($value,true) : ''; } } \ No newline at end of file