wang hou sheng 8 months ago
parent 038dd03899
commit 694f2caf8c
  1. 7
      app/common/library/wxserver/Server.php

@ -310,9 +310,9 @@ class Server
*/ */
public function getTemplatelist(): array public function getTemplatelist(): array
{ {
if (Cache::has('wx_server_templatelist')) { // if (Cache::has('wx_server_templatelist')) {
return Cache::get('wx_server_templatelist'); // return Cache::get('wx_server_templatelist');
} // }
$token = $this->getComponentAccessToken(); $token = $this->getComponentAccessToken();
$list = []; $list = [];
if ($token) { if ($token) {
@ -320,6 +320,7 @@ class Server
$data['template_type'] = 1; $data['template_type'] = 1;
$result = $this->curlGet($url, $data); $result = $this->curlGet($url, $data);
$result = json_decode($result, true); $result = json_decode($result, true);
return $result;
if ($result && !empty($result['template_list'])) { if ($result && !empty($result['template_list'])) {
$template_list = $result['template_list']; $template_list = $result['template_list'];
foreach ($template_list as $value) { foreach ($template_list as $value) {

Loading…
Cancel
Save