Loading src/Handler/MessageHandler.php +18 −2 Original line number Diff line number Diff line Loading @@ -53,15 +53,31 @@ class MessageHandler * @param $content * @throws HttpResponseException */ public function sendText($receiverIds, $content) public function sendText($receiverIds, $content, $sendUserId = null) { $application = $this->config->get('app_name'); if (!$application) { throw new HttpResponseException("请设置应用名app_name"); } $receiverIds = is_array($receiverIds) ? $receiverIds : [$receiverIds]; $sendUserId = Auth::id(); $sendUserId =$sendUserId ?: Auth::id(); $this->messageService->send($receiverIds, $application, 0, $sendUserId, [], $content); } /** * 定时任务专用 发送文本消息 * @param $receiverIds * @param $content * @throws HttpResponseException */ public function sendCrontabText($receiverIds, $content) { $application = $this->config->get('app_name'); if (!$application) { throw new HttpResponseException("请设置应用名app_name"); } $receiverIds = is_array($receiverIds) ? $receiverIds : [$receiverIds]; $this->messageService->send($receiverIds, $application, 0, 0, [], $content); } } Loading
src/Handler/MessageHandler.php +18 −2 Original line number Diff line number Diff line Loading @@ -53,15 +53,31 @@ class MessageHandler * @param $content * @throws HttpResponseException */ public function sendText($receiverIds, $content) public function sendText($receiverIds, $content, $sendUserId = null) { $application = $this->config->get('app_name'); if (!$application) { throw new HttpResponseException("请设置应用名app_name"); } $receiverIds = is_array($receiverIds) ? $receiverIds : [$receiverIds]; $sendUserId = Auth::id(); $sendUserId =$sendUserId ?: Auth::id(); $this->messageService->send($receiverIds, $application, 0, $sendUserId, [], $content); } /** * 定时任务专用 发送文本消息 * @param $receiverIds * @param $content * @throws HttpResponseException */ public function sendCrontabText($receiverIds, $content) { $application = $this->config->get('app_name'); if (!$application) { throw new HttpResponseException("请设置应用名app_name"); } $receiverIds = is_array($receiverIds) ? $receiverIds : [$receiverIds]; $this->messageService->send($receiverIds, $application, 0, 0, [], $content); } }