|
|
|
@ -226,8 +226,8 @@ class Server |
|
|
|
|
*/ |
|
|
|
|
public function getTemplatedraftlist() |
|
|
|
|
{ |
|
|
|
|
if (Cache::has('templatedraftlist')) { |
|
|
|
|
return Cache::get('templatedraftlist'); |
|
|
|
|
if (Cache::has('wx_server_drafttemplatelist')) { |
|
|
|
|
return Cache::get('wx_server_drafttemplatelist'); |
|
|
|
|
} |
|
|
|
|
$token = $this->getComponentAccessToken(); |
|
|
|
|
$list = []; |
|
|
|
@ -245,7 +245,7 @@ class Server |
|
|
|
|
'id' => $value['draft_id'], |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
Cache::set('templatelist', $list, 86400); |
|
|
|
|
Cache::set('wx_server_drafttemplatelist', $list, 86400); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return $list; |
|
|
|
@ -274,7 +274,7 @@ class Server |
|
|
|
|
$res = $this->curlPost($url, json_encode($data)); |
|
|
|
|
$res = json_decode($res, true); |
|
|
|
|
if ($res && !empty($res['errmsg']) && $res['errmsg'] == 'ok') { |
|
|
|
|
Cache::delete('templatelist'); |
|
|
|
|
Cache::delete('wx_server_templatelist'); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -296,7 +296,7 @@ class Server |
|
|
|
|
$res = $this->curlPost($url, json_encode($data)); |
|
|
|
|
$res = json_decode($res, true); |
|
|
|
|
if ($res && !empty($res['errmsg']) && $res['errmsg'] == 'ok') { |
|
|
|
|
Cache::delete('templatelist'); |
|
|
|
|
Cache::delete('wx_server_templatelist'); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -310,8 +310,8 @@ class Server |
|
|
|
|
*/ |
|
|
|
|
public function getTemplatelist(): array |
|
|
|
|
{ |
|
|
|
|
if (Cache::has('templatelist')) { |
|
|
|
|
return Cache::get('templatelist'); |
|
|
|
|
if (Cache::has('wx_server_templatelist')) { |
|
|
|
|
return Cache::get('wx_server_templatelist'); |
|
|
|
|
} |
|
|
|
|
$token = $this->getComponentAccessToken(); |
|
|
|
|
$list = []; |
|
|
|
@ -334,7 +334,7 @@ class Server |
|
|
|
|
'draft_id' => $value['draft_id'], |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
Cache::set('templatelist', $list, 86400); |
|
|
|
|
Cache::set('wx_server_templatelist', $list, 86400); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return $list; |
|
|
|
|