2026-03-21 02:55:24 +08:00
|
|
|
<?php
|
|
|
|
|
// +----------------------------------------------------------------------
|
2026-03-29 11:22:52 +08:00
|
|
|
// | Author: ScottPan Team
|
2026-03-21 02:55:24 +08:00
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
namespace app\services\message\notice;
|
|
|
|
|
|
|
|
|
|
use app\jobs\notice\EnterpriseWechatJob;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 企业微信发送消息
|
|
|
|
|
* Created by PhpStorm.
|
|
|
|
|
* User: xurongyao <763569752@qq.com>
|
|
|
|
|
* Date: 2021/9/22 1:23 PM
|
|
|
|
|
*/
|
|
|
|
|
class EnterpriseWechatService extends BaseNoticeService
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 发送消息
|
|
|
|
|
* @param array $data 模板内容
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
|
|
|
|
public function sendMsg($data)
|
|
|
|
|
{
|
|
|
|
|
return $this->handle(function ($data) {
|
|
|
|
|
$url = $this->config['url'] ?? '';
|
|
|
|
|
$ent_wechat_text = $this->config['ent_wechat_text'] ?? '';
|
|
|
|
|
EnterpriseWechatJob::dispatchDo('doJob', [$data, $url, $ent_wechat_text]);
|
|
|
|
|
}, [$data]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|