|
|
@@ -83,9 +83,16 @@ class WechatTemplateService implements ProviderInterface
|
|
|
{
|
|
|
@file_put_contents('quanju.txt', $templateId."-模版id\r\n", 8);
|
|
|
$tempid = WechatTemplateModel::vialdWhere()->where('tempkey', $templateId)->where('status', 1)->value('tempid');
|
|
|
- @file_put_contents('quanju.txt', json_encode($tempid)."-tempid\r\n", 8);
|
|
|
+ @file_put_contents('quanju.txt', $tempid."-tempid\r\n", 8);
|
|
|
@file_put_contents('quanju.txt', WechatTemplateModel::getlastSql()."-tempid\r\n", 8);
|
|
|
- if (!$tempid) return false;
|
|
|
+ if (!$tempid){
|
|
|
+ $tempid = WechatTemplateModel::where('tempkey', $templateId)->where('status', 1)->value('tempid');
|
|
|
+ @file_put_contents('quanju.txt', $tempid."-tempid2\r\n", 8);
|
|
|
+ @file_put_contents('quanju.txt', WechatTemplateModel::getlastSql()."-tempid2\r\n", 8);
|
|
|
+ if (!$tempid){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
try {
|
|
|
$res=WechatService::sendTemplate($openid, $tempid, $data, $url, $defaultColor);
|
|
|
return $res;
|