diff --git a/app/common/library/wxserver/Server.php b/app/common/library/wxserver/Server.php index e050dfef..1cbffd25 100644 --- a/app/common/library/wxserver/Server.php +++ b/app/common/library/wxserver/Server.php @@ -129,13 +129,13 @@ class Server * @notes:发布版本 * @param $appid * @param $template_id - * @return true|void + * @return bool * @throws DataNotFoundException * @throws DbException * @throws ModelNotFoundException|BaseException * @author: wanghousheng */ - public function commit($appid, $template_id) + public function commit($appid, $template_id): bool { $version = ''; $desc = ''; @@ -168,7 +168,6 @@ class Server $url = 'https://api.weixin.qq.com/wxa/commit?access_token=' . $access_token; $result = $this->curlPost($url, json_encode($data)); $result = json_decode($result, true); - return $result; if ($result && !empty($result['errmsg']) && $result['errmsg'] == 'ok') { $model->update(['version' => $version . $desc], ['id' => $info['id']]); return true; @@ -274,16 +273,6 @@ class Server */ public function addTotemplate($draft_id): bool { - $templateList = []; - if (Cache::has('wx_server_templatelist')) { - $templateList = Cache::get('wx_server_templatelist'); - } - if ($templateList) { - $draft_ids = array_column($templateList, 'draft_id'); - if (in_array($draft_id, $draft_ids)) { - return true; - } - } $token = $this->getComponentAccessToken(); if ($token) { $url = 'https://api.weixin.qq.com/wxa/addtotemplate?access_token=' . $token;