master
yulingwei 5 years ago
parent 33049f5a9f
commit 555fd052fe

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

@ -217,7 +217,8 @@
<td colspan="99" class="text-center">
<span>总押金:{$total['totalamount']}</span>&nbsp;&nbsp;&nbsp;&nbsp;
<span>待确认押金:{$total['unconfirmedamount']}</span>&nbsp;&nbsp;&nbsp;&nbsp;
<span>已确认押金:{$total['confirmedamount']}</span>
<span>已确认押金:{$total['confirmedamount']}</span>&nbsp;&nbsp;&nbsp;&nbsp;
<span>已退款押金:{$total['refundedamount']}</span>&nbsp;&nbsp;&nbsp;&nbsp;
</td>
</tr>
</tbody>

Loading…
Cancel
Save