1. For example, for N sales orders, I want to count the sales of each item every day, but if I use sum () to sum, I will delete all my other fields. Is there any way to keep the fields and sum
2. Raw data
$data = array(
array(
"date" => 2019-01-01,
"goods" => ,
"num" => 1,
"price" => 50.00,
),
array(
"date" => 2019-01-01,
"goods" => ,
"num" => 1,
"price" => 70.00,
),
array(
"date" => 2019-01-01,
"goods" => ,
"num" => 1,
"price" => 70.00,
),
array(
"date" => 2019-01-02,
"goods" => ,
"num" => 1,
"price" => 50.00,
),
);
the result I want is
2019-01-01 = array(
array(
"date" => 2019-01-01,
"goods" => ,
"num" => 1,
"price" => 50.00,
),
array(
"date" => 2019-01-01,
"goods" => ,
"num" => 2,
"price" => 140.00,
),
);
2019-01-02 = array(
array(
"date" => 2019-01-02,
"goods" => ,
"num" => 1,
"price" => 50.00,
),
);