| xqd
@@ -622,15 +622,19 @@ if (!function_exists('send_wechat_message_to_docter')) {
|
|
|
if (!function_exists('send_wechatSubscription_message')) {
|
|
|
function send_wechatSubscription_message($type, $arr,$message='docter_wechat_small_program')
|
|
|
{
|
|
|
+ trace(['模板消息进入数据类型' =>$type , '请求参数' => $arr ?? '', '模板标识' => $message ?? ''], 'lyh_info');
|
|
|
+
|
|
|
try {
|
|
|
$app = Factory::miniProgram(config('config.'.$message));
|
|
|
$data = config('config.wechatSubscription_template')[$type];
|
|
|
+ trace(['模板消息进入数据类型' =>$type , '请求参数' => $arr ?? '', '模板' => $data ?? ''], 'lyh_info');
|
|
|
+
|
|
|
$json = json_encode($data, JSON_UNESCAPED_UNICODE);
|
|
|
$json = vsprintf($json, $arr);
|
|
|
$data = json_decode($json, true);
|
|
|
$result = $app->uniform_message->send($data);
|
|
|
} catch (Exception $e) {
|
|
|
- trace(['发送微信模板消息失败' => $e->getMessage(), '请求参数' => $data ?? '', '返回数据' => $result ?? ''], 'error');
|
|
|
+ trace(['发送微信模板消息失败' => $e->getMessage(), '请求参数' => $data ?? '', '返回数据' => $result ?? ''], 'lyh_error');
|
|
|
}
|
|
|
return $result ?? false;
|
|
|
}
|