Yii DAO group by and group_concat
{Coding}
$data_type_maps = Yii::app()->db->createCommand()
->select('group_concat(`map_name` ORDER BY num_download_all DESC separator \'-\') AS mix_map_name,
group_concat(`map_img` ORDER BY num_download_all DESC separator \'-\') AS mix_map_img,
group_concat(`id` ORDER BY num_download_all DESC separator \'-\') AS mix_map_id,
map_type_id')
->from('sc2m_map')
->where('status_type_id='.Yii::app()->params['valuePass'])
->group('map_type_id')
->queryAll();
{Point}
group_concat(`map_name` ORDER BY num_download_all DESC separator \'-\')
Leave Comment