推荐应用
DIY记录调用只调用每个用户的最新一条记录
发布于 2013-09-08
修改文件:
source\class\block\space\block_doing.php
搜索:
source\class\block\space\block_doing.php
搜索:
$query = C::t('home_doing')->fetch_all_by_uid_doid($uids, $bannedids, $parameter['orderby'], $startrow, $items, true, true);
删掉后在原位置加上:if (!empty($parameter['bannedids'])) {
$screenid = ' where doid not in ('.$parameter['bannedids'].')';
} else {
$screenid = '';
}
$datas = DB::fetch_all('select uid,max(dateline) as maxdateline from pre_home_doing'.$screenid.' group by uid order by maxdateline desc limit 10');
$query = array();
foreach($datas as $data){
$uid = $data['uid'];
$maxdateline = $data['maxdateline'];
$sql = "select * from pre_home_doing where uid='{$uid}' and dateline='{$maxdateline}' limit 1";
$record = mysql_fetch_array(mysql_query($sql),MYSQL_ASSOC);
$query[] = $record;
}
覆盖上传即可