|
@@ -1414,8 +1414,14 @@ class Payment extends BaseController
|
|
|
//结算invlist这个接口当用payNo筛选的时候,返回列表里需要加一项统计筛选后列表的inv_subtotal_amount、total字段的和
|
|
|
$inv_subtotal_amount = $total = 0;
|
|
|
if ($payNo != '') {
|
|
|
- $inv_subtotal_amount = round(array_sum(array_column($list, 'inv_subtotal_amount')), 2);
|
|
|
- $total = round(array_sum(array_column($list, 'total')), 2);
|
|
|
+ $inv_subtotal_amount = round(Db::name("pay_invoice")
|
|
|
+ ->alias("a")
|
|
|
+ ->leftJoin("pay b", "a.payNo=b.payNo")
|
|
|
+ ->where($condition)
|
|
|
+ ->sum('a.inv_subtotal_amount'), 2);
|
|
|
+ $total = round(Db::name("invoice_info")
|
|
|
+ ->where(["hpNo" => array_column($list, 'hpNo'), "status" => 1])
|
|
|
+ ->sum('total'), 2);
|
|
|
}
|
|
|
|
|
|
return app_show(0, "获取成功", [
|