[notice]服务类

This commit is contained in:
2025-06-24 09:43:56 +08:00
parent 879982f3f3
commit 16dc063a39

View File

@ -0,0 +1,24 @@
<?php
namespace jerryyan\notice\service;
use jerryyan\notice\model\NoticeNotice;
use think\admin\Service;
class NoticeService extends Service
{
public static function send_notice_to($type = '', $content = '', $link = '', $users = []): int
{
$notices = [];
foreach ($users as $user) {
$notices[] = [
'type' => $type,
'content' => $content,
'link' => $link,
'staff_id' => $user,
];
}
return NoticeNotice::mk()->insertAll($notices);
}
}