21,887
社区成员
发帖
与我相关
我的任务
分享
function get_kaohe_reply_list($kaohe_id,$page,$size)
{
global $fdyu,$db,$action_list,$school_id;
$sql = "SELECT reply.reply_id,reply.content FROM ".$fdyu->table('oa_kaohe_reply')." as reply
where reply.post_id=".$kaohe_id."";
$res = $db->selectLimit($sql, $size, ($page-1) * $size);
if($res)
{
$arr = array();
while($row = $db->fetchRow($res))
{
$reply_id = $row['reply_id'];
$arr[$reply_id]['reply_id'] = $reply_id;
$arr[$reply_id]['content'] = $row['content'];
$sql1 = "SELECT * FROM ".$fdyu->table('oa_kaohe_tiwen_nr')." where r_id=".$reply_id." ".$sql_where."";
$res1 = $db->query($sql1);
if($res1)
{
while($row1 = $db->fetchRow($res1))
{
$nr_id = $row1['nr_id'];
$arr[$reply_id]['nr_list'][$nr_id]['nr_id'] = $nr_id;
$arr[$reply_id]['nr_list'][$nr_id]['tx_nr'] = $row1['tx_nr'];
}
}
}
}
return $arr;
}
$replys_list=get_kaohe_reply_list($kaohe_id,$page,$size);
$smarty->assign('kaohereply', $replys_list);
这样