master
yulingwei 4 years ago
parent 25dec010be
commit deac7da5ff

@ -31,6 +31,12 @@ class PresidentDepositController extends ThinkController
$promoteIds = []; $promoteIds = [];
if ($status !== '') { if ($status !== '') {
if ($status == '-1') { // 市场待审核
$tempPromoteIds = M('president_deposit', 'tab_')->getField('promote_id', true);
if (count($tempPromoteIds) > 0) {
$idStrWhere[] = 'id not in (' . implode(',', $tempPromoteIds) . ')';
}
} else {
$tempPromoteIds = M('president_deposit', 'tab_')->where(['status' => $status])->getField('promote_id', true); $tempPromoteIds = M('president_deposit', 'tab_')->where(['status' => $status])->getField('promote_id', true);
if (count($tempPromoteIds) > 0) { if (count($tempPromoteIds) > 0) {
$idStrWhere[] = 'id in (' . implode(',', $tempPromoteIds) . ')'; $idStrWhere[] = 'id in (' . implode(',', $tempPromoteIds) . ')';
@ -38,6 +44,7 @@ class PresidentDepositController extends ThinkController
$idStrWhere[] = '1<>1'; $idStrWhere[] = '1<>1';
} }
} }
}
if (!empty(I('pay_confirm_time_start')) && empty(I('pay_confirm_time_end'))) { if (!empty(I('pay_confirm_time_start')) && empty(I('pay_confirm_time_end'))) {
$startTime = strtotime(I('pay_confirm_time_start')); $startTime = strtotime(I('pay_confirm_time_start'));
@ -158,6 +165,9 @@ class PresidentDepositController extends ThinkController
// 汇总金额 // 汇总金额
if (count($promotes) > 0 || (isset($count) && $count > 0)) { if (count($promotes) > 0 || (isset($count) && $count > 0)) {
$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(); $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();
$total = [
'totalamount' => $total['totalamount'] ?? 0, 'confirmedamount' => $total['confirmedamount'] ?? 0, 'refundedamount' => $total['refundedamount'] ?? 0
];
} else { } else {
$total = [ $total = [
'totalamount' => 0, 'confirmedamount' => 0, 'refundedamount' => 0 'totalamount' => 0, 'confirmedamount' => 0, 'refundedamount' => 0

@ -84,6 +84,7 @@
<div class="input-list input-list-promote search_label_rehab"> <div class="input-list input-list-promote search_label_rehab">
<select id="status" name="status" class="select_gallery" style="width:120px;"> <select id="status" name="status" class="select_gallery" style="width:120px;">
<option value="">押金状态</option> <option value="">押金状态</option>
<option value="-1">市场待确认</option>
<?php foreach($statusList as $key => $name):?> <?php foreach($statusList as $key => $name):?>
<option value="<?=$key?>"><?=$name?></option> <option value="<?=$key?>"><?=$name?></option>
<?php endforeach;?> <?php endforeach;?>

Loading…
Cancel
Save