0

在此处输入图像描述

这是我从 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_by 的数组总和需要按 created_by 计数分组。

4

0 回答 0