|
|
@ -1234,6 +1234,8 @@ class FinanceController extends ThinkController
|
|
|
|
$spend = M('value_detail_log', 'tab_')->where($map5)->sum('value');
|
|
|
|
$spend = M('value_detail_log', 'tab_')->where($map5)->sum('value');
|
|
|
|
if(empty($spend)) {
|
|
|
|
if(empty($spend)) {
|
|
|
|
$spend = '0.00';
|
|
|
|
$spend = '0.00';
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
$spend = number_format(abs($spend),2,'.','');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$map6['user_id'] = $id;
|
|
|
|
$map6['user_id'] = $id;
|
|
|
|
$map6['pay_type'] = 2;
|
|
|
|
$map6['pay_type'] = 2;
|
|
|
@ -1271,14 +1273,15 @@ class FinanceController extends ThinkController
|
|
|
|
$allpromoteCoin = empty($promoteCoin) ? '0.00' : number_format($allpromoteCoin,2,'.','');
|
|
|
|
$allpromoteCoin = empty($promoteCoin) ? '0.00' : number_format($allpromoteCoin,2,'.','');
|
|
|
|
|
|
|
|
|
|
|
|
$map4['create_time'] = $map['create_time'];
|
|
|
|
$map4['create_time'] = $map['create_time'];
|
|
|
|
$banlace = M('value_detail_log', 'tab_')->field('user_id, after_value')->where($map4)->group('user_id')->select();
|
|
|
|
$banlace = M('value_detail_log', 'tab_')->field('user_id, after_value')->where($map4)->order('create_time desc')->limit(1)->select();
|
|
|
|
$banlaceTotal = '0.00';
|
|
|
|
$banlaceTotal = '0.00';
|
|
|
|
foreach($banlace as $k222 => $vvv) {
|
|
|
|
foreach($banlace as $k222 => $vvv) {
|
|
|
|
$banlaceTotal += $vvv['after_value'];
|
|
|
|
$banlaceTotal += $vvv['after_value'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$banlaceTotal = number_format($banlaceTotal,2,'.','');
|
|
|
|
$banlaceTotal = number_format($banlaceTotal,2,'.','');
|
|
|
|
$map['user_id'] = ['in', $ids];
|
|
|
|
$map['user_id'] = ['in', $ids];
|
|
|
|
$newValueByTimeDatas = M('value_detail_log', 'tab_')->field('user_id, after_value')->where($map)->group('user_id')->select();
|
|
|
|
$newValueByTimeDatas = M('value_detail_log', 'tab_')->field('user_id, after_value, create_time')->where($map)->order('create_time desc')->limit(1)->select();
|
|
|
|
|
|
|
|
|
|
|
|
// var_dump($newValueByTimeDatas);die();
|
|
|
|
// var_dump($newValueByTimeDatas);die();
|
|
|
|
foreach ($allDatas as $k => $allData) {
|
|
|
|
foreach ($allDatas as $k => $allData) {
|
|
|
|
$allDatas[$k]['after_value'] = "0.00";
|
|
|
|
$allDatas[$k]['after_value'] = "0.00";
|
|
|
@ -1300,9 +1303,8 @@ class FinanceController extends ThinkController
|
|
|
|
$this->assign('endtime', $initEndTime);
|
|
|
|
$this->assign('endtime', $initEndTime);
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
$this->assign('starttime', $_REQUEST['timestart']);
|
|
|
|
$this->assign('starttime', $_REQUEST['timestart']);
|
|
|
|
$this->assign('endtime', $_REQUEST['endtime']);
|
|
|
|
$this->assign('endtime', $_REQUEST['timeend']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//var_dump($allDatas);die();
|
|
|
|
|
|
|
|
$this->assign('banlaceTotal', $banlaceTotal);
|
|
|
|
$this->assign('banlaceTotal', $banlaceTotal);
|
|
|
|
$this->assign('total', $totalSpend);
|
|
|
|
$this->assign('total', $totalSpend);
|
|
|
|
$this->assign('deposit', $deposit);
|
|
|
|
$this->assign('deposit', $deposit);
|
|
|
@ -1334,6 +1336,9 @@ class FinanceController extends ThinkController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$total = '0.00';
|
|
|
|
$total = '0.00';
|
|
|
|
$t = M('value_detail_log', 'tab_')->where($map)->sum('value');
|
|
|
|
$t = M('value_detail_log', 'tab_')->where($map)->sum('value');
|
|
|
|
|
|
|
|
if (empty($t)) {
|
|
|
|
|
|
|
|
$t = '0.00';
|
|
|
|
|
|
|
|
}
|
|
|
|
$valueDetailDatas = M('value_detail_log', 'tab_')->field('order_number, user_id, before_value, value, after_value, create_time, type, remark, pay_type')
|
|
|
|
$valueDetailDatas = M('value_detail_log', 'tab_')->field('order_number, user_id, before_value, value, after_value, create_time, type, remark, pay_type')
|
|
|
|
->where($map)
|
|
|
|
->where($map)
|
|
|
|
->page($page,$row)
|
|
|
|
->page($page,$row)
|
|
|
@ -1367,15 +1372,21 @@ class FinanceController extends ThinkController
|
|
|
|
$totalAfterValue = '0.00';
|
|
|
|
$totalAfterValue = '0.00';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$total = number_format($total,2,'.','');
|
|
|
|
$total = number_format($total,2,'.','');
|
|
|
|
// if($total >= 0 ) {
|
|
|
|
if($t >= 0 ) {
|
|
|
|
// $fuhao = '+';
|
|
|
|
$fuhao = '+';
|
|
|
|
// }else {
|
|
|
|
}else {
|
|
|
|
// $fuhao = '-';
|
|
|
|
$fuhao = '-';
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
$page = set_pagination($counts,$row);
|
|
|
|
$page = set_pagination($counts,$row);
|
|
|
|
if($page) {$this->assign('_page', $page);}
|
|
|
|
if($page) {$this->assign('_page', $page);}
|
|
|
|
$this->assign('fuhao', $fuhao);
|
|
|
|
$this->assign('fuhao', $fuhao);
|
|
|
|
|
|
|
|
if(empty($_REQUEST['timestart']) && empty($_REQUEST['timeend']) && empty(I('user_account'))) {
|
|
|
|
|
|
|
|
$this->assign('starttime', $initBegTime);
|
|
|
|
|
|
|
|
$this->assign('endtime', $initEndTime);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
$this->assign('starttime', $_REQUEST['timestart']);
|
|
|
|
|
|
|
|
$this->assign('endtime', $_REQUEST['endtime']);
|
|
|
|
|
|
|
|
}
|
|
|
|
$this->assign('total', $t);
|
|
|
|
$this->assign('total', $t);
|
|
|
|
$this->assign('listdata', $vlaueDetailDatas);
|
|
|
|
$this->assign('listdata', $vlaueDetailDatas);
|
|
|
|
$this->assign('totalAfterValue', $totalAfterValue);
|
|
|
|
$this->assign('totalAfterValue', $totalAfterValue);
|
|
|
|