[34] => Array
(
[sum] => 13
[name] =>
[id] => 27
[parentid] => 1
[children] => Array
(
)
)
[35] => Array
(
[sum] => 2
[name] =>
[id] => 31
[parentid] => 1
[children] => Array
(
[0] => Array
(
[sum] => 156
[name] =>
[id] => 52
[parentid] => 31
[children] => Array
(
)
)
[1] => Array
(
[sum] => 12
[name] =>
[id] => 54
[parentid] => 31
[children] => Array
(
)
)
[2] => Array
(
[sum] => 20
[name] =>
[id] => 53
[parentid] => 31
[children] => Array
(
)
)
[3] => Array
(
[sum] => 10
[name] =>
[id] => 55
[parentid] => 31
[children] => Array
(
)
)
[4] => Array
(
[sum] => 55
[name] =>
[id] => 51
[parentid] => 31
[children] => Array
(
)
)
)
)
[36] => Array
(
[sum] => 56
[name] =>
[id] => 32
[parentid] => 1
[children] => Array
(
)
)
how to calculate the summ value of the third branch is the sum of all the sum under the children of the third branch