From 15b17f4a89deac0182e4cf2bd53e343049d2bc0e Mon Sep 17 00:00:00 2001 From: cody <648753004@qq.com> Date: Thu, 19 Jun 2025 15:22:34 +0800 Subject: [PATCH] update --- app/Console/Commands/SendNotification.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/SendNotification.php b/app/Console/Commands/SendNotification.php index c9c1a71..2f94613 100755 --- a/app/Console/Commands/SendNotification.php +++ b/app/Console/Commands/SendNotification.php @@ -239,9 +239,10 @@ class SendNotification extends Command $this->smsNotice($vo, $content); break; case "App\Notifications\BirthdayNotify": - // 排课通知 + // 生日通知,todo::文案待定 $user = User::find($data['user_id']); - $content = "{$smsSign}亲爱的同学:祝您生日快乐!"; + $url = $this->urlLink(); + $content = "{$smsSign}亲爱的同学:祝您生日快乐!登陆小程序有惊喜:{$url}"; $this->smsNotice($vo, $content); break; } @@ -260,6 +261,20 @@ class SendNotification extends Command return $str; } + /** + * 获取跳转短链接 + */ + public function urlLink() + { + $config = [ + 'app_id' => config('app.applet_appid'), + 'secret' => config('app.applet_secret') + ]; + $app = Factory::miniProgram($config); + $result = $app->url_link->generate([]); + return $result['url_link'] ?? ''; + } + /** * 发送小程序通知 */