|
|
|
@ -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();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|