mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-08-09 23:19:45 +08:00
Update Menu.php
This commit is contained in:
parent
6dea24e112
commit
210a17bcb6
@ -26,6 +26,12 @@ use think\exception\HttpResponseException;
|
|||||||
*/
|
*/
|
||||||
class Menu extends Controller
|
class Menu extends Controller
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* 存储数据名称
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $ckey = 'wechat_menu_data';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信菜单的类型
|
* 微信菜单的类型
|
||||||
* @var array
|
* @var array
|
||||||
@ -56,7 +62,7 @@ class Menu extends Controller
|
|||||||
if ($this->request->get('output') === 'json') {
|
if ($this->request->get('output') === 'json') {
|
||||||
$where = [['keys', 'notin', ['subscribe', 'default']], ['status', '=', '1']];
|
$where = [['keys', 'notin', ['subscribe', 'default']], ['status', '=', '1']];
|
||||||
$keys = $this->app->db->name('WechatKeys')->where($where)->order('sort desc,id desc')->select();
|
$keys = $this->app->db->name('WechatKeys')->where($where)->order('sort desc,id desc')->select();
|
||||||
$this->success('获取数据成功!', ['wechat_menud_ata' => sysdata('wechat_menu_data'), 'keysdata' => $keys]);
|
$this->success('获取数据成功!', ['wechat_menud_ata' => sysdata($this->ckey), 'keysdata' => $keys]);
|
||||||
} else {
|
} else {
|
||||||
$this->title = '微信菜单定制';
|
$this->title = '微信菜单定制';
|
||||||
$this->fetch();
|
$this->fetch();
|
||||||
@ -84,8 +90,8 @@ class Menu extends Controller
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
sysdata('wechat_menu_data', $this->_buildMenuData(json_decode($data, true)));
|
sysdata($this->ckey, $this->_buildMenuData(json_decode($data, true)));
|
||||||
WechatService::WeChatMenu()->create(['button' => sysdata('wechat_menu_data')]);
|
WechatService::WeChatMenu()->create(['button' => sysdata($this->ckey)]);
|
||||||
sysoplog('微信管理', '发布微信菜单成功');
|
sysoplog('微信管理', '发布微信菜单成功');
|
||||||
$this->success('保存发布菜单成功!', '');
|
$this->success('保存发布菜单成功!', '');
|
||||||
} catch (HttpResponseException $exception) {
|
} catch (HttpResponseException $exception) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user