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