SDK用户菜单

master
Your Name 5 years ago
parent 118340fa33
commit 2eff781166

@ -8,10 +8,13 @@ class SdkMenuController extends ThinkController{
{
$sdkMenus = M('tool','tab_')->where(['name' => 'sdk_menu'])->find();
$config = json_decode($sdkMenus['config'],true);
if(!empty($config))
{
foreach($config as $k => $v)
{
$config[$k]['icon'] = is_https()?'https://':'http://' . $_SERVER['SERVER_NAME'] . $v['icon'];
}
}
$this->assign('list',$config);
$this->meta_title = 'SDk用户菜单';
$this->display('lists');
@ -38,7 +41,15 @@ class SdkMenuController extends ThinkController{
$post['id'] = $id;
array_push($config,$post);
$sdkMenus['config'] = json_encode($config);
if(empty($sdkMenus['name']))
{
$sdkMenus['name'] = 'sdk_menu';
$sdkMenus['title'] = 'SDK用户菜单';
M('tool','tab_')->data($sdkMenus)->add();
}else
{
M('tool','tab_')->where(['name' => 'sdk_menu'])->data($sdkMenus)->save();
}
$this->success('新增成功', U('lists'));
}

Loading…
Cancel
Save