改进 Key 获取

This commit is contained in:
iVampireSP.com 2023-02-13 00:45:57 +08:00
parent 7fa1ccf755
commit 65c1612955
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -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 [