Array
(
[0] => Array
(
[oid] => 190
[color] =>
[goods_name] => 测试要
[goods_num] => 1
[goods_price] => 0.01
[id] => 44
[img] => /Public/Uploads/2017-12-13/5a30fa5763bdb.jpg
[user_openid] => oWWUP0dieOLSHl3CzjyHIcIdhtVo
[order_number] => 20181513226463
[tid] => 92
[status] => 1
[tuiid] =>
[aid] =>
[gid] =>
[corm_time] => 1514862004
)
[1] => Array
(
[oid] => 191
[color] =>
[goods_name] => A5笔记本子
[goods_num] => 2
[goods_price] => 0.01
[id] => 43
[img] => /Public/Uploads/2017-12-06/5a27add5325d1.jpg
[user_openid] => oWWUP0dieOLSHl3CzjyHIcIdhtVo
[order_number] => 20181513241259
[tid] => 93
[status] => 1
[tuiid] =>
[aid] =>
[gid] =>
[corm_time] => 1514862004
)
[2] => Array
(
[oid] => 193
[color] =>
[goods_name] => 测试要
[goods_num] => 1
[goods_price] => 0.01
[id] => 46
[img] => /Public/Uploads/2017-12-13/5a30fa5763bdb.jpg
[user_openid] => oWWUP0dieOLSHl3CzjyHIcIdhtVo
[order_number] => 20181513241259
[tid] => 93
[status] => 1
[tuiid] =>
[aid] =>
[gid] =>
[corm_time] => 1514862004
)
)
如上数组是 $a ;
我需求出上面数组的 goods_num 之和 最终组合成下面这个样的数组,请大神们帮个忙吧!
Array
(
[0] => Array
(
[name] => 测试要
[number] => 2
)
[1] => Array
(
[name] => A5笔记本子
[number] => 2
)
)
完全没有头绪,也不知道怎么搞。。。。反正就是各种懵逼了!!!~
我通过直接在数据库计算,出现这样的结果
Array
(
[0] => Array
(
[name] => 测试要
[number] => 2
)
[1] => Array
(
[name] => A5笔记本子
[number] => 2
)
[2] => Array
(
[name] => 测试要
[number] => 2
)
)
但是去重又是个问题了。我实在不知道咋搞了。。还是得求大神啊!!!
慕田峪4524236
小怪兽爱吃肉
潇潇雨雨
慕姐8265434