$rs = DB::fetch_all('select count(1) as credit, fid from %t forum_groupcreditslog where logdate >= %s group by fid order by credit desc limit 12', array('forum_groupcreditslog', $olddate));
foreach($rs as $v) {
$_group = DB::fetch_first("SELECT * FROM ".DB::table('forum_forum')." f LEFT JOIN ".DB::table("forum_forumfield")." ff ON ff.fid=f.fid WHERE f.fid = {$v['fid']} and f.type='sub' AND f.status=3");