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