有两个数组
第一个数组
Array
(
[0] => Array
(
[SUM(j.Amount)] =>
[DebitAccount] =>
)
[1] => Array
(
[SUM(j.Amount)] => 15842.88
[DebitAccount] => 2310
)
[2] => Array
(
[SUM(j.Amount)] => 3656.68
[DebitAccount] => 2380
)
[3] => Array
(
[SUM(j.Amount)] => 12178.20
[DebitAccount] => 2610
)
)
第二个数组
Array
(
[0] => Array
(
[SUM(j.Amount)] =>
[CreditAccount] =>
)
[1] => Array
(
[SUM(j.Amount)] => 15842.88
[CreditAccount] => 2310
)
[2] => Array
(
[SUM(j.Amount)] => 30916.44
[CreditAccount] => 2380
)
[3] => Array
(
[SUM(j.Amount)] => 3133.70
[CreditAccount] => 2620
)
)
什么是目标?需要得到这样的输出
帐号为 2310,值为 0.00 (15842.88 - 15842.88)
帐号为 2380,值为 -30916.40 (3656.68 - 30916.44)
帐号是 2610,值是 12178.20 (12178.20 (DebitAccount) - 0.00 (CreditAccount))
帐号为 2620,值为 -3133.70 (0.00 (DebitAccount) - 3133.70 (CreditAccount))
现在试图了解如何做这样的事情if(DebitAccount == CreditAccount){from (corresponding DebitAccount SUM(j.Amount)) deduct (corresponding CreditAccount SUM(j.Amount));}
你能建议如何达到目标吗?