|
|
|
@ -94,10 +94,11 @@ class Information_model extends CI_Model {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//在同级别下,随机获取N条数据,并且排除某些id
|
|
|
|
|
function random($topnum,$is_parent_id,array $exclude_ids){
|
|
|
|
|
function random($topnum,$is_path,array $exclude_ids){
|
|
|
|
|
$this->init();
|
|
|
|
|
$this->topNum = $topnum;
|
|
|
|
|
$this->search = " AND is_parent_id =". $this->HT->escape($is_parent_id);
|
|
|
|
|
$this->search = " AND is1.is_path LIKE '$is_path%' ";
|
|
|
|
|
//$this->search = " AND is_parent_id =". $this->HT->escape($is_parent_id);
|
|
|
|
|
$exclude_ids_string=implode(',',$exclude_ids);
|
|
|
|
|
$this->search .= " AND ic_status=1 AND is_id NOT in ($exclude_ids_string,0)";
|
|
|
|
|
$this->orderBy = " ORDER BY NewID() ";
|
|
|
|
|