|
|
|
@ -1142,8 +1142,10 @@ class Information extends CI_Controller
|
|
|
|
|
}
|
|
|
|
|
//读取备用节点
|
|
|
|
|
if (empty($data) && !empty($recommand->ir_urls)) {//查不到信息并且备选urls不为空,则随机选一条
|
|
|
|
|
// $url_array = explode("\n", $recommand->ir_urls);
|
|
|
|
|
// $data = $this->Information_model->Detail(trim($url_array[rand(0, count($url_array) - 1)]));
|
|
|
|
|
$url_array = explode("\n", $recommand->ir_urls);
|
|
|
|
|
$data = $this->Information_model->Detail(trim($url_array[rand(0, count($url_array) - 1)]));
|
|
|
|
|
$data = $this->Information_model->random_range(1,$url_array, $exclude_ids);
|
|
|
|
|
}
|
|
|
|
|
if (!empty($data)) {
|
|
|
|
|
$exclude_ids[] = $data->is_id;
|
|
|
|
@ -1174,7 +1176,6 @@ class Information extends CI_Controller
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($group_recommands as $item) {
|
|
|
|
|
if (empty($data[$item->ir_name])) {
|
|
|
|
|
$result = $this->recommand_information_rule($information, $root_detail, $item, $exclude_ids);
|
|
|
|
@ -1184,6 +1185,7 @@ class Information extends CI_Controller
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//print_r($data);
|
|
|
|
|
//log_message('error', 'exclude_ids: '.$information->ic_url.' '.implode(',',$exclude_ids));
|
|
|
|
|
return $data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|