我有一个这样的数组,我是通过数据库查询(Google BigQuery)得到的:
Array
(
[0] => Array
(
[points] => 95
[user] => 434
[type] => 20
[identifier] => tv
[date] => 2016-11-01
)
[1] => Array
(
[points] => 349
[id] => 2989631
[type] => 20
[identifier] => app
[date] => 2016-11-01
)
)
另一个用于标识符:
Array
(
[tv] => 1
[app] => 2
)
我需要做的是转换数组,因为标识符键具有标识符数组中的相应值。所以它看起来像:
Array
(
[0] => Array
(
[points] => 95
[user] => 434
[type] => 20
[identifier] => 1
[date] => 2016-11-01
)
[1] => Array
(
[points] => 349
[id] => 2989631
[type] => 20
[identifier] => 2
[date] => 2016-11-01
)
)
如何使用 Laravel 集合做到这一点?
我一直在尝试使用变换函数,但没有想到从多维数组中返回特定列。