|
|
@@ -80,11 +80,14 @@ class WechatTemplateService implements ProviderInterface
|
|
|
public static function sendTemplate($openid, $templateId, array $data, $url = null, $defaultColor = '')
|
|
|
{
|
|
|
$tempid = WechatTemplateModel::vialdWhere()->where('tempkey', $templateId)->where('status', 1)->value('tempid');
|
|
|
+ @file_put_contents('quanju.txt', $tempid. "-模版消息123\r\n", 8);
|
|
|
if (!$tempid) return false;
|
|
|
try {
|
|
|
- return WechatService::sendTemplate($openid, $tempid, $data, $url, $defaultColor);
|
|
|
+ $res=WechatService::sendTemplate($openid, $tempid, $data, $url, $defaultColor);
|
|
|
+ @file_put_contents('quanju.txt', json_encode($res). "-模版消息456\r\n", 8);
|
|
|
+ return $res;
|
|
|
} catch (\Exception $e) {
|
|
|
- return false;
|
|
|
+ return $e->getMessage();
|
|
|
}
|
|
|
}
|
|
|
|