信呼OA版本v2.3.8
This commit is contained in:
32
webmain/main/yingyong/menuAction.php
Normal file
32
webmain/main/yingyong/menuAction.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
class menuClassAction extends Action
|
||||
{
|
||||
|
||||
public function dataAjax()
|
||||
{
|
||||
$this->rows = array();
|
||||
$where = $this->rock->covexec($this->post('where'));
|
||||
$this->getmenu(0, 1, $where);
|
||||
|
||||
echo json_encode(array(
|
||||
'totalCount'=> 0,
|
||||
'rows' => $this->rows
|
||||
));
|
||||
}
|
||||
|
||||
private function getmenu($pid, $oi, $wh='')
|
||||
{
|
||||
$db = m('menu');
|
||||
$menu = $db->getall("`pid`='$pid' $wh order by `sort`",'*');
|
||||
foreach($menu as $k=>$rs){
|
||||
$sid = $rs['id'];
|
||||
$rs['level'] = $oi;
|
||||
$rs['stotal'] = $db->rows("`pid`='$sid' $wh ");
|
||||
$this->rows[] = $rs;
|
||||
|
||||
$this->getmenu($sid, $oi+1, $wh);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user