class plugin_bullmarket_onlinetime { function plugin_bullmarket_onlinetime() { } }class plugin_bullmarket_onlinetime_forum{ function viewthread_sidebottom_output($a) { global $_G, $postlist; $result=array(); //根据应用审核员返回结果,现对数据库查询进行优化,增加一次循环,用于将$postlist中的pid筛选为一维数组,以减少查询次数, //将分次查询改成单次查询,且改为联合查询 $pidlist=array(); foreach($postlist as $pids) { array_push($pidlist,$pids['pid']); } $totallist=DB::fetch_all("select total from ".DB::table("common_onlinetime ")." left join ".DB::table("forum_post ")." on ".DB::table("common_onlinetime ").".uid"."=".DB::table("forum_post ").".authorid where pid IN (%n)",array($pidlist)); for($i=0;$i<count($postlist);$i++) { $total=empty($totallist[$i]['total'])?"0":$totallist[$i]['total']; array_push($result,'<dl class="pil cl"><dt>'.lang('plugin/bullmarket_onlinetime', 's001') .'</dt><dd style="color:#F00">'.$total.lang('plugin/bullmarket_onlinetime', 's002').'</dd></dl>'); } return $result; }}
添加回答
举报
0/150
提交
取消