From 65c16129552055cbb86e54d25720bd80ca92699e Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Mon, 13 Feb 2023 00:45:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20Key=20=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Notifications/WorkOrder/WorkOrder.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/app/Notifications/WorkOrder/WorkOrder.php b/app/Notifications/WorkOrder/WorkOrder.php index 5482a29..428249c 100644 --- a/app/Notifications/WorkOrder/WorkOrder.php +++ b/app/Notifications/WorkOrder/WorkOrder.php @@ -79,18 +79,12 @@ public function toWeCom(WorkOrderModel $workOrder): false|array { $workOrder->load(['module', 'user']); - $module = null; + $wecom_key = config('settings.wecom.robot_hook.default'); + if ($workOrder->module) { $module = $workOrder->module; - // 取消隐藏字段 - $module->makeVisible(['wecom_key']); - } - - if ($module?->wecom_key == null) { - $wecom_key = config('settings.wecom.robot_hook.default'); - } else { - $wecom_key = $module->wecom_key; + $wecom_key = $module->makeVisible(['wecom_key'])->wecom_key ?? $wecom_key; } return [