public function getmenu() { if (C("AUTH_ON")) { $idstr = getUserGroupids(); $map['id'] = array('in', "{$idstr}"); } $menu = M("menu"); $map['pid'] = array("eq", 0); $map['status'] = array('eq', 1); $menuList = $menu->where($map)->order("listorder DESC")->select(); //菜单成绩关系 $this->assign("menuList", $menuList); $this->display(); }
public function getmenu() { if (IS_POST) { $pid = I('pid'); $menu = D(Menu); $map['pid'] = array("eq", $pid); $map['status'] = array('eq', 1); if (C("AUTH_ON")) { $idstr = getUserGroupids(); $map['id'] = array('in', "{$idstr}"); } $list = $menu->where($map)->order("listorder DESC")->select(); if ($list) { $str = '<ul>'; foreach ($list as $k => $v) { $str .= "<li onclick='qkhl_nav(this)' status='0' "; if ($v['controller'] != "Default") { // $str .="url='".__APP__."/{$v['module']}/{$v['controller']}/{$v['action']}{$v['data']}'"; $str .= "url='" . __MODULE__ . "/{$v['controller']}/{$v['action']}{$v['data']}'"; } $str .= " pid='{$v['id']}' ><span class='{$v['icon']}'></span> <span>{$v['name']}</span></li>"; } $str .= "</ul>"; echo $str; } else { echo ""; } } }