From 8b044cce46f8bf845c4e05cb5df8947bfc17d1e5 Mon Sep 17 00:00:00 2001 From: weiz <736250432@qq.com> Date: Fri, 24 May 2024 11:58:17 +0800 Subject: [PATCH] update --- .../lists/financial/FinancialCollectionPlanLists.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/adminapi/lists/financial/FinancialCollectionPlanLists.php b/app/adminapi/lists/financial/FinancialCollectionPlanLists.php index 87e9322ab..3044810d9 100644 --- a/app/adminapi/lists/financial/FinancialCollectionPlanLists.php +++ b/app/adminapi/lists/financial/FinancialCollectionPlanLists.php @@ -68,13 +68,13 @@ ->order(['id' => 'desc']) ->select()->each(function ($data) { $contract = MarketingContract::field('contract_name,contract_type,business_nature,part_a,signed_amount,create_time')->where('id', $data['contract_id'])->findOrEmpty(); - $data['contract_name'] = $contract?->contract_name; - $data['contract_type'] = $contract?->contract_type_text; - $data['business_nature'] = $contract?->business_nature_text; - $data['signed_amount'] = $contract?->signed_amount; - $data['signed_date'] = $contract?->create_time; + $data['contract_name'] = !$contract->isEmpty() ? $contract['contract_name'] : ''; + $data['contract_type'] = !$contract->isEmpty() ? $contract->contract_type_text : ''; + $data['business_nature'] = !$contract->isEmpty() ? $contract->business_nature_text : ''; + $data['signed_amount'] = !$contract->isEmpty() ? $contract['signed_amount'] : ''; + $data['signed_date'] = !$contract->isEmpty() ? $contract['signed_date'] : ''; $admin = Admin::field('name')->where('id', $data['collection_user'])->findOrEmpty(); - $data['collection_user_name'] = $admin?->name; + $data['collection_user_name'] = !$admin->isEmpty() ? $admin['name'] : ''; }) ->toArray(); }