$datas = [];
$data =model('user')
->order('createdate desc')
->field('age, is_pay, star, cid, createdate, path')
->where('id', $id])
->select();
//createdate 是要分组的字段
foreach($data as $index => $value) {
$datas[$value['createdate']][] = $value;
}
PHP根据某个字端重新分组
最新推荐文章于 2021-03-21 11:07:05 发布