model = new SysNotice(); } /** * 消息发送 * @param $key * @param $data * @return false|mixed * @throws \Exception */ public static function send($key, $data) { try { $template = (new CoreNoticeService())->getInfo($key); Log::write("消息发送"); Log::write($template); if (empty($template)) return false; return Notice::dispatch(['key' => $key, 'data' => $data, 'template' => $template], is_async: $template['async']); } catch (\Exception $e) { throw new NoticeException($e->getMessage()); } } }