From 20ac65f12a2cdc7bbe2ad00a52b89b3e695d5583 Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Tue, 14 Jul 2020 17:14:54 +0800 Subject: [PATCH] upt --- .../PresidentDepositController.class.php | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Application/Admin/Controller/PresidentDepositController.class.php b/Application/Admin/Controller/PresidentDepositController.class.php index 54ad99d6e..bc72db3c6 100644 --- a/Application/Admin/Controller/PresidentDepositController.class.php +++ b/Application/Admin/Controller/PresidentDepositController.class.php @@ -41,7 +41,7 @@ class PresidentDepositController extends ThinkController if (!empty(I('pay_confirm_time_start')) && empty(I('pay_confirm_time_end'))) { $startTime = strtotime(I('pay_confirm_time_start')); - $endTime = strtotime(I('pay_confirm_time_end')); + $endTime = strtotime(I('pay_confirm_time_end')) + 86400; $tempPromoteIds = M('president_deposit', 'tab_')->where("pay_confirm_time >= {$startTime}")->getField('promote_id', true); if (count($tempPromoteIds) > 0) { $idStrWhere[] = 'id in (' . implode(',', $tempPromoteIds) . ')'; @@ -50,7 +50,7 @@ class PresidentDepositController extends ThinkController } } else if (empty(I('pay_confirm_time_start')) && !empty(I('pay_confirm_time_end'))) { $startTime = strtotime(I('pay_confirm_time_start')); - $endTime = strtotime(I('pay_confirm_time_end')); + $endTime = strtotime(I('pay_confirm_time_end')) + 86400; $tempPromoteIds = M('president_deposit', 'tab_')->where("pay_confirm_time <= {$endTime}")->getField('promote_id', true); if (count($tempPromoteIds) > 0) { $idStrWhere[] = 'id in (' . implode(',', $tempPromoteIds) . ')'; @@ -59,7 +59,7 @@ class PresidentDepositController extends ThinkController } } else if (!empty(I('pay_confirm_time_start')) && !empty(I('pay_confirm_time_end'))) { $startTime = strtotime(I('pay_confirm_time_start')); - $endTime = strtotime(I('pay_confirm_time_end')); + $endTime = strtotime(I('pay_confirm_time_end')) + 86400; $tempPromoteIds = M('president_deposit', 'tab_')->where("pay_confirm_time >= {$startTime} and pay_confirm_time <= {$endTime}")->getField('promote_id', true); if (count($tempPromoteIds) > 0) { $idStrWhere[] = 'id in (' . implode(',', $tempPromoteIds) . ')'; @@ -70,7 +70,7 @@ class PresidentDepositController extends ThinkController if (!empty(I('refund_time_start')) && empty(I('refund_time_end'))) { $startTime = strtotime(I('refund_time_start')); - $endTime = strtotime(I('refund_time_end')); + $endTime = strtotime(I('refund_time_end')) + 86400; $tempPromoteIds = M('president_deposit', 'tab_')->where("refund_time >= {$startTime}")->getField('promote_id', true); if (count($tempPromoteIds) > 0) { $idStrWhere[] = 'id in (' . implode(',', $tempPromoteIds) . ')'; @@ -79,7 +79,7 @@ class PresidentDepositController extends ThinkController } } else if (empty(I('refund_time_start')) && !empty(I('refund_time_end'))) { $startTime = strtotime(I('refund_time_start')); - $endTime = strtotime(I('refund_time_end')); + $endTime = strtotime(I('refund_time_end'))+ 86400; $tempPromoteIds = M('president_deposit', 'tab_')->where("refund_time <= {$endTime}")->getField('promote_id', true); if (count($tempPromoteIds) > 0) { $idStrWhere[] = 'id in (' . implode(',', $tempPromoteIds) . ')'; @@ -88,7 +88,7 @@ class PresidentDepositController extends ThinkController } } else if (!empty(I('refund_time_start')) && !empty(I('refund_time_end'))) { $startTime = strtotime(I('refund_time_start')); - $endTime = strtotime(I('refund_time_end')); + $endTime = strtotime(I('refund_time_end'))+ 86400; $tempPromoteIds = M('president_deposit', 'tab_')->where("refund_time >= {$startTime} and refund_time <= {$endTime}")->getField('promote_id', true); if (count($tempPromoteIds) > 0) { $idStrWhere[] = 'id in (' . implode(',', $tempPromoteIds) . ')'; @@ -99,7 +99,7 @@ class PresidentDepositController extends ThinkController if (!empty(I('pay_accept_time_start')) && empty(I('pay_accept_time_end'))) { $startTime = strtotime(I('pay_accept_time_start')); - $endTime = strtotime(I('pay_accept_time_end')); + $endTime = strtotime(I('pay_accept_time_end'))+ 86400; $tempPromoteIds = M('president_deposit', 'tab_')->where("pay_confirm_time >= {$startTime}")->getField('promote_id', true); if (count($tempPromoteIds) > 0) { $idStrWhere[] = 'id in (' . implode(',', $tempPromoteIds) . ')'; @@ -108,7 +108,7 @@ class PresidentDepositController extends ThinkController } } else if (empty(I('pay_accept_time_start')) && !empty(I('pay_accept_time_end'))) { $startTime = strtotime(I('pay_accept_time_start')); - $endTime = strtotime(I('pay_accept_time_end')); + $endTime = strtotime(I('pay_accept_time_end'))+ 86400; $tempPromoteIds = M('president_deposit', 'tab_')->where("pay_confirm_time <= {$endTime}")->getField('promote_id', true); if (count($tempPromoteIds) > 0) { $idStrWhere[] = 'id in (' . implode(',', $tempPromoteIds) . ')'; @@ -117,7 +117,7 @@ class PresidentDepositController extends ThinkController } } else if (!empty(I('pay_accept_time_start')) && !empty(I('pay_accept_time_end'))) { $startTime = strtotime(I('pay_accept_time_start')); - $endTime = strtotime(I('pay_accept_time_end')); + $endTime = strtotime(I('pay_accept_time_end'))+ 86400; $tempPromoteIds = M('president_deposit', 'tab_')->where("pay_accept_time >= {$startTime} and pay_accept_time <= {$endTime}")->getField('promote_id', true); if (count($tempPromoteIds) > 0) { $idStrWhere[] = 'id in (' . implode(',', $tempPromoteIds) . ')'; @@ -144,10 +144,11 @@ class PresidentDepositController extends ThinkController if (I('export', 0) == 1) { $promotes = $query->select(); } else { + $totalQuery = clone $query; $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(); + $total = M('president_deposit', 'tab_')->where(['promote_id'=>['in', $totalQuery->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(); }