WIN-2308041133\Administrator 4 months ago
parent
commit
35990a7049
1 changed files with 3 additions and 2 deletions
  1. 3 2
      crmeb/services/WechatTemplateService.php

+ 3 - 2
crmeb/services/WechatTemplateService.php

@@ -86,12 +86,13 @@ class WechatTemplateService implements ProviderInterface
         @file_put_contents('quanju.txt',  $tempid."-tempid\r\n", 8);
         @file_put_contents('quanju.txt',  WechatTemplateModel::getlastSql()."-tempid\r\n", 8);
         if (!$tempid){
-            $tempid = WechatTemplateModel::where('tempkey', $templateId)->where('status', 1)->value('tempid');
-            @file_put_contents('quanju.txt',  $tempid."-tempid2\r\n", 8);
+            $tempid = WechatTemplateModel::where('tempkey', $templateId)->find();
+            @file_put_contents('quanju.txt',  json_encode($tempid)."-tempid2\r\n", 8);
             @file_put_contents('quanju.txt',  WechatTemplateModel::getlastSql()."-tempid2\r\n", 8);
             if (!$tempid){
                 return false;
             }
+            $tempid = $tempid['tempid'];
         }
         try {
                 $res=WechatService::sendTemplate($openid, $tempid, $data, $url, $defaultColor);