我正在使用DQL进行查询
$query = $this->createQueryBuilder('i')
->select('(i.sortiesNoSortie)','COUNT(i.participantsNoParticipant)')
->groupBy('i.sortiesNoSortie');
$result = $query->getQuery()->getArrayResult();但我得到了这个
array:3 [
0 => array:2 [
1 => "76"
2 => "1"
]
1 => array:2 [
1 => "82"
2 => "1"
]
2 => array:2 [
1 => "83"
2 => "1"
]
]我想把它放在一个简单的数组中,从我的select中获取键和值
76 => 1
82 => 1
83 => 1 这有可能吗?
https://stackoverflow.com/questions/55367461
复制相似问题