打开CategoryModel.class.php
public function getChildrenId($cate){
$field = 'id,name,pid,ti
$category = D('Category')->getTree($cate, $field);
$ids = array();
$ids[]='in';
foreach ($category['_'] as $key => $value) {
$ids[] = $value['id'];
}
return implode(',', $ids);
}
改成:
public function getChildrenId($cate){
$field = 'id,name,pid,ti
$category = D('Category')->getTree($cate, $field);
$ids = array();
$ids[]='in';
foreach ($category['_'] as $key => $value) {
$ids[] = $value['id'];
}
$ids[]=$cate;
return implode(',', $ids);
}
还有些小技巧,过几天发………………
最佳答案
