【发布时间】:2021-11-08 22:18:01
【问题描述】:
执行查询后,我有这个奇怪的数组输出,它看起来像这样
array:32 [▼
0 => array:1 [▼
"key" => "overview.domain"
]
1 => array:1 [▼
"key" => "overview.msg_latest_translation"
]
2 => array:1 [▼
"key" => "overview.no_stats"
]
但我只希望它是一个数组,而不是嵌套数组。 所以它看起来像这样
array:32 [▼
"overview.domain",
"overview.msg_latest_translation",
"overview.no_stats"
]
解决这个问题的最佳方法是什么?
这是我正在执行的查询,它给了我第一个输出:
return $this->createQueryBuilder('t')
->select('t.key')
->getQuery()
->getResult()
;
【问题讨论】: