|
|
@ -4,9 +4,13 @@ use Think\Controller;
|
|
|
|
|
|
|
|
|
|
|
|
class IndexWidget extends Controller{
|
|
|
|
class IndexWidget extends Controller{
|
|
|
|
|
|
|
|
|
|
|
|
public function navigation($value='',$compare='')
|
|
|
|
public function navigation($value='',$compare='',$title='')
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$mainID = M('Menu')->where("pid !=0 AND url like '%".$value."%'")->getField('id');
|
|
|
|
$where = "pid !=0 AND url like '%".$value."%'";
|
|
|
|
|
|
|
|
if ($title != '') {
|
|
|
|
|
|
|
|
$where .= ' AND title=\'' . $title . '\'';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$mainID = M('Menu')->where($where)->getField('id');
|
|
|
|
$MainMenu = M('Menu')->field("id,pid,title,url,status,hide")->where(array('pid'=>$mainID,'hide'=>0))->order("sort asc")->select();
|
|
|
|
$MainMenu = M('Menu')->field("id,pid,title,url,status,hide")->where(array('pid'=>$mainID,'hide'=>0))->order("sort asc")->select();
|
|
|
|
$this->assign("data",$MainMenu);
|
|
|
|
$this->assign("data",$MainMenu);
|
|
|
|
$compare = empty($compare)?CONTROLLER_NAME."/".ACTION_NAME:$compare;
|
|
|
|
$compare = empty($compare)?CONTROLLER_NAME."/".ACTION_NAME:$compare;
|
|
|
|