$data = $db->select('am_table_main', '*',['ORDER'=>['added_time'=>'DESC']]);
$new_data = [];
foreach($data as $key => &$val){
$val['month'] = mb_substr($val['added_time'], 0 ,7);
$new_data[$val['month']][] = $val;
}
unset($val);
2022-10-25 11:49:26
$data = $db->select('am_table_main', '*',['ORDER'=>['added_time'=>'DESC']]);
$new_data = [];
foreach($data as $key => &$val){
$val['month'] = mb_substr($val['added_time'], 0 ,7);
$new_data[$val['month']][] = $val;
}
unset($val);