tp查询数据进行筛选排序

将查询的二维数组进行合并

$info = array_merge($info,$data_name);

循环遍历(去掉重复),存入$info

foreach ($info as $key=>$val){
    if (in_array($val,$data_one)){
        unset($info[$key]);
    }else{
        $data_one[] = $val;
    }
}

按照gain_points字段进行降序排序

$last_names = array_column($data_one,'gain_points');
array_multisort($last_names,SORT_DESC,$data_one);

打印数据

halt(data_one);

原文链接:tp查询数据进行筛选排序

个人博客:www.liusongs.com

猜你喜欢

转载自blog.csdn.net/qq_35630665/article/details/88036412
今日推荐