From 555fd052fef255e1723f11e273db3699c569ed6e Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Tue, 14 Jul 2020 16:12:59 +0800 Subject: [PATCH] upt --- .../Admin/Controller/PresidentDepositController.class.php | 8 +++----- Application/Admin/View/PresidentDeposit/records.html | 3 ++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Application/Admin/Controller/PresidentDepositController.class.php b/Application/Admin/Controller/PresidentDepositController.class.php index 67f86d97f..54ad99d6e 100644 --- a/Application/Admin/Controller/PresidentDepositController.class.php +++ b/Application/Admin/Controller/PresidentDepositController.class.php @@ -146,6 +146,8 @@ class PresidentDepositController extends ThinkController } else { $countQuery = clone $query; $promotes = $query->page($page, $row)->select(); + // 汇总金额 + $total = M('president_deposit', 'tab_')->where(['promote_id'=>['in', $countQuery->getField('id', true)]])->field('sum(amount) as totalAmount, sum(if(status = 1, amount, 0)) as confirmedAmount, sum(if(status = 2, amount, 0)) as refundedAmount')->find(); $count = $countQuery->count(); } @@ -241,12 +243,8 @@ class PresidentDepositController extends ThinkController exit; } } - $this->checkListOrCountAuthRestMap($map,[]); - - // 汇总金额 - $total = M('president_deposit', 'tab_')->field('sum(amount) as totalAmount, sum(if(status = 1, amount, 0)) as confirmedAmount')->find(); - $total['unconfirmedamount'] = $total['totalamount'] - $total['confirmedamount']; + $total['unconfirmedamount'] = $total['totalamount'] - $total['confirmedamount'] - $total['refundedamount']; $page = set_pagination($count, $row); if($page) { $this->assign('_page', $page); diff --git a/Application/Admin/View/PresidentDeposit/records.html b/Application/Admin/View/PresidentDeposit/records.html index 378cfde03..a501d106a 100644 --- a/Application/Admin/View/PresidentDeposit/records.html +++ b/Application/Admin/View/PresidentDeposit/records.html @@ -217,7 +217,8 @@ 总押金:{$total['totalamount']}     待确认押金:{$total['unconfirmedamount']}     - 已确认押金:{$total['confirmedamount']} + 已确认押金:{$total['confirmedamount']}     + 已退款押金:{$total['refundedamount']}