public function subchapt()
{
$result = $this->recursive_subchapter_id($level_title);
}
public function recursive_subchapter_id($level_title)
{
$level_data = $this->db->query("SELECT * FROM presto_project_level WHERE level_title ='". $level_title."'")->result_array();
if(count($level_data)>0){
$parentid1 = '';
$leveltitle1 = '';
$parentid1 = trim($level_data[0]['parent_id']);
$leveltitle1 = trim($level_data[0]['level_title']);
if($parentid1 == '0') {
return $leveltitle1;die;
}
else
{
$res = $this->recursive_subchapter_id($parentid1);
return $res;die;
}
}
else{
return $level_title;die;
}
}
每次获取结果数组为null。我直接在url中尝试过,所以它给出了结果数组及其计数。但是从其他函数调用时,计数为零。
答案 0 :(得分:1)
而不是检查public List<Vehicle> search(
@RequestParam(value="make", required=false) String make,
@RequestParam(value="model", required=false) String model,
@RequestParam(value="type", required=false) List<String> types,
@RequestParam(value="color", required=false) List<String> colors)
{
....
}
中的parentid
,而是检入recursive_subchapter_id()
,然后在不满足条件的情况下再次调用subchapt()
。