我正在尝试从上图中获取正确的有序值,我希望该值如下所示
2,3,4,5,6,7,8,19,9,20,10,11,12,13...18 (the order is from left top to right bottom)
我在下面使用此功能
function getUserEmptyLeg($sponsor_id){
$data_params = array(
":placement_id" => $sponsor_id,
":status" => "aktif"
);
$data = fetchAll("SELECT * FROM users WHERE placement_id =:placement_id AND STATUS=:status", $data_params);
$new_sponsor_ids = array();
$member = array();
foreach($data as $row){
$member[$row['user_id']] = array(
"placement_id" => $row['placement_id'],
"user_id" => $row['user_id'],
"member_name" => $row['username'],
"leg" => $row['leg']
);
$new_sponsor_ids[] = $row['user_id'];
}
foreach($new_sponsor_ids as $new_sponsor_id){
$member = array_merge($member, getUserEmptyLeg($new_sponsor_id));
}
return $member;
}
上述函数的结果
2,3,4,5,8,9,10,11,12,13,14,...18,6,7,19,20
但上述函数的结果并没有像我预期的那样输出结果。我正在尽最大努力把我的问题说清楚,如果你们在回答时感到困惑,我很抱歉。但我需要大家的帮助,谢谢。