"FROM " . $GLOBALS['ecs']->table('feedback') . " AS f ".
"LEFT JOIN " . $GLOBALS['ecs']->table('feedback') . " AS r ON r.parent_id=f.msg_id ".
$sql = "SELECT f.msg_id, f.user_name, f.msg_title, f.msg_type, f.order_id, f.msg_status, f.msg_time, f.msg_area " .
"FROM " . $GLOBALS['ecs']->table('feedback') . " AS f ".
//"LEFT JOIN " . $GLOBALS['ecs']->table('feedback') . " AS r ON r.parent_id=f.msg_id ".
"WHERE f.parent_id = 0 $where " .
"GROUP BY f.msg_id ".
"ORDER by $filter[sort_by] $filter[sort_order] ".
"LIMIT " . $filter['start'] . ', ' . $filter['page_size'];
二、在下面的foreach里面增加:
$msg_list[$key]['reply'] = $GLOBALS['db']->getOne("sel ect count(msg_id) reply from ".$GLOBALS['ecs']->table('feedback')." where parent_id ='".$value['msg_id']."'");