基于键的数组总和(按用户分组)

ca1c2owp  于 2021-06-21  发布在  Mysql
关注(0)|答案(0)|浏览(250)

在此处输入图像描述
这是我从mysql得到的第一个数组

Array    
([0] => Array
    (
        [created_by] => 4
        [count] => 1
        [total] => 300
    )

[1] => Array 
    (
        [created_by] => 4
        [count] => 1
        [total] => 450
    )

[2] => Array
    (
        [created_by] => 3
        [count] => 1
        [total] => 500
    )

)
我需要一个输出作为

[0] => Array
    (
        [created_by] => 4
        [count] => 2
        [total] => 750
    )

[1] => Array
    (
        [created_by] => 3
        [count] => 1
        [total] => 500
    )

基于created\u by need到group by created\u by count的数组总数之和。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题