$New_Album_List = Db::name('MediaAlbum a')->join($this->_tab_prefix."user u", "a.user_id=u.user_id")
->join($this->_tab_prefix."fm_sound fm","fm.album_id=a.album_id")
->where('a.is_auditing=1 and a.media_type=1'.($channel_id>0?' and a.channel_id='.$channel_id:' and channel_id in ('.$ids.')'))
->field('u.nick_name,a.album_id,a.album_title,a.album_thumbnail,a.view_count,fm.is_recommend')
->order('fm.is_recommend desc,a.update_time desc')
->group('a.album_id')
->paginate(8,false,['path' => $Url,'query'=> ['channel_id'=>$channel_id]]);
/* 此处也可以用下图的方法修改,分页的Url地址 */
$this->assign('page', $New_Album_List->render());
/* 获取最新的fm导入查询专辑$New_Album_List */
$New_Album_List = $New_Album_List->toArray();
//var_dump($New_Album_List);exit();
if (!empty($New_Album_List['data'])) {
foreach ($New_Album_List['data'] as $k => $v) {
//$v['sound_id'] = '';
//$v['sound_title'] = '';
//print_r($v['album_id']);echo "
";
$List_Fm_Sound = Db::name('FmSound')->where($v['album_id']>0?'album_id='.$v['album_id']:'1=1'.' and is_auditing=1')->field('sound_id,sound_title')->order('add_time desc')->find();
$New_Album_List['data'][$k]['sound_id'] = $List_Fm_Sound?$List_Fm_Sound['sound_id']:0;
$New_Album_List['data'][$k]['sound_title'] = $List_Fm_Sound?$List_Fm_Sound['sound_title']:0;
}
}
//print_r($New_Album_List['data']);
$this->assign('new_album_list',$New_Album_List['data']);
return $this->fetch('fm_class_pc');