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];