SDK用户菜单

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

@ -8,9 +8,12 @@ class SdkMenuController extends ThinkController{
{
$sdkMenus = M('tool','tab_')->where(['name' => 'sdk_menu'])->find();
$config = json_decode($sdkMenus['config'],true);
foreach($config as $k => $v)
if(!empty($config))
{
$config[$k]['icon'] = is_https()?'https://':'http://' . $_SERVER['SERVER_NAME'] . $v['icon'];
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用户菜单';
@ -38,7 +41,15 @@ class SdkMenuController extends ThinkController{
$post['id'] = $id;
array_push($config,$post);
$sdkMenus['config'] = json_encode($config);
M('tool','tab_')->where(['name' => 'sdk_menu'])->data($sdkMenus)->save();
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