master
cody 6 months ago
parent a62e8a9436
commit 15b17f4a89

@ -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'] ?? '';
}
/**
* 发送小程序通知
*/

Loading…
Cancel
Save