From c53744db2e10f0cc5d3930c68080416907d20670 Mon Sep 17 00:00:00 2001 From: weiz <736250432@qq.com> Date: Thu, 25 Jan 2024 09:34:48 +0800 Subject: [PATCH] update --- app/common/model/supplier/SupplierContacts.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/common/model/supplier/SupplierContacts.php b/app/common/model/supplier/SupplierContacts.php index 96b4d5315..6fcfa41c8 100644 --- a/app/common/model/supplier/SupplierContacts.php +++ b/app/common/model/supplier/SupplierContacts.php @@ -50,19 +50,19 @@ class SupplierContacts extends BaseModel public function getContactsTypeTextAttr($value,$data): string { $dict = DictData::where('type_value','contacts_type')->column('name','value'); - return $dict[$data['contacts_type']]; + return !empty($data['contacts_type']) ? $dict[$data['contacts_type']] : ''; } public function getContactsCateTextAttr($value,$data): string { $dict = DictData::where('type_value','contacts_cate')->column('name','value'); - return $dict[$data['contacts_cate']]; + return !empty($data['contacts_cate']) ? $dict[$data['contacts_cate']] : ''; } public function getIdTypeTextAttr($value,$data): string { $dict = DictData::where('type_value','id_type')->column('name','value'); - return $dict[$data['id_type']]; + return !empty($data['id_type']) ? $dict[$data['id_type']] : ''; } public function supplier(){