日期:2014-05-16 浏览次数:20502 次
public function _getMenu($id=0,$t=0){
$category = M("category");
$data = $category->where("pid=$id")->order("sort asc")->select();
if($data){
$t++;
$data2['leavel'] = $t;
$category->where("pid=$id")->save($data2); //层级
foreach($data as $key=>$value){
$sort = $value['sort'];
$id = $value['id'];
$this->str .= '<tr><td><input name = "ids['.$id.']" type = "text" value = "'.$sort.'"></td>';
$this->str .= "<td>". $value['id']."</td>";
if($t>1){
if()
$this->str .= "<td>|-----".$value['name']."</td>";
}else{
$this->str .= "<td>".$value['name']."</td>";
}
$this->str .= "<td>".$value['group']."</td>";
$id = $value['id'];
$this->str .= '<td><a href = http://localhost/tptest/index.php/Article/deletelanmu?id='.$id.'>删除</a></td></tr>';
$this->_getMenu($value['id'],$t);
}
}
}