wang hou sheng 11 months ago
parent 6bb8e577b8
commit dbba7081b2
  1. 7
      app/admin/controller/Wxserve.php
  2. 9
      app/common/library/wxserver/Server.php

@ -81,11 +81,13 @@ class Wxserve extends Controller
*/
public function templatedraftlist(): Json
{
$type = intval($this->request->get('type', 0));
$obj = new Server();
$list = $obj->getTemplateDraftList();
$list = $obj->getTemplateDraftList($type);
return $this->renderSuccess($list);
}
/**
* @notes:添加草稿到模板中
* @return Json
@ -111,8 +113,9 @@ class Wxserve extends Controller
*/
public function templatelist(): Json
{
$type = intval($this->request->get('type', 0));
$obj = new Server();
$list = $obj->getTemplatelist();
$list = $obj->getTemplatelist($type);
return $this->renderSuccess($list);
}

@ -237,9 +237,9 @@ class Server
* @return array|mixed
* @author: wanghousheng
*/
public function getTemplatedraftlist()
public function getTemplatedraftlist($type)
{
if (Cache::has('wx_server_drafttemplatelist')) {
if (!$type && Cache::has('wx_server_drafttemplatelist')) {
return Cache::get('wx_server_drafttemplatelist');
}
$token = $this->getComponentAccessToken();
@ -318,12 +318,13 @@ class Server
/**
* @notes:代码模板列表
* @param $type
* @return array
* @author: wanghousheng
*/
public function getTemplatelist(): array
public function getTemplatelist($type): array
{
if (Cache::has('wx_server_templatelist')) {
if (!$type && Cache::has('wx_server_templatelist')) {
return Cache::get('wx_server_templatelist');
}
$token = $this->getComponentAccessToken();

Loading…
Cancel
Save