Explorar o código

发送客服消息增加日志

liuzejian hai 1 ano
pai
achega
e7699a10b9
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      app/Service/WechatPlatform/GZHSendKFMessageService.php

+ 5 - 1
app/Service/WechatPlatform/GZHSendKFMessageService.php

@@ -19,8 +19,12 @@ class GZHSendKFMessageService
      */
     public static function sendText($officialAccount, $openid, $content, $traceContext) {
         try {
-            $officialAccount->customer_service->message($content)
+            $res = $officialAccount->customer_service->message($content)
                 ->to($openid)->send();
+            myLog('KFMessageSend')->debug('客服消息发送结果:', [
+                'res' => $res,
+                'traceInfo' => $traceContext->getTraceInfo()
+            ]);
             return true;
         } catch (\Throwable $exception) {
             myLog('KFMessageSend')->error('发送客服消息失败', [