zilong 4 년 전
부모
커밋
600dc7e14e
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      app/Helpers/functions.php

+ 3 - 0
app/Helpers/functions.php

xqd
@@ -545,6 +545,9 @@ if (!function_exists('send_wechat_message')) {
             $json = vsprintf($json, $official_arr);
             $data = json_decode($json, true);
             $ret = $app->uniform_message->send($data);
+            if (empty($subscribe_arr) && (!isset($ret['errcode']) || $ret['errcode'] != 0)) {
+                trace(['发送微信模板消息失败,请求参数' => $data, '返回数据' => $ret], 'error');
+            }
             //如果模板消息发送失败(可能因用户没有关注公众号而失败)再发送订阅消息
             if (!empty($subscribe_arr) && isset($ret['errcode']) && $ret['errcode'] != 0) {
                 $data = config('config.wechat_subscribe_message_template')[$type];