diff --git a/Application/Home/Controller/FinanceController.class.php b/Application/Home/Controller/FinanceController.class.php index f8b4e8ceb..b9d6d174f 100644 --- a/Application/Home/Controller/FinanceController.class.php +++ b/Application/Home/Controller/FinanceController.class.php @@ -182,6 +182,7 @@ class FinanceController extends BaseController $parameter['endtime'] = $initEndTime; $data = []; + $total = []; $count = 0; if (intval($endTime - $begTime) / (24 * 3600) <= 31) { $withdrawIds = []; @@ -222,6 +223,10 @@ class FinanceController extends BaseController ->page($page, $row) ->select(); $count = $model->where($map)->count(); + $total = $model->field('sum(pay_amount) as pay_amount,pay_way,sum(if(selle_ratio >= 0,selle_ratio * pay_amount,0)) as income') + ->where($map) + ->find(); + $total['income'] = bcdiv($total['income'], 100, 2); //提现状态 if (empty($withdrawIds)) { @@ -264,6 +269,7 @@ class FinanceController extends BaseController $this->assign('listData', $data); $this->assign('count', $count); + $this->assign('total', $total); $this->assign('initBegTime', $initBegTime); $this->assign('initEndTime', $initEndTime); $this->assign('_page', $page); diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 908a5c82e..f7e04a452 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -91,6 +91,7 @@ class QueryController extends BaseController $data = []; $count = 0; + $income = '0.00'; if (intval($endTime - $begTime) / (24 * 3600) <= 31) { $data = M('Spend', 'tab_') ->field('tab_spend.*,tab_promote.account as pro_account,tab_promote.real_name as pro_real_name,tab_promote.chain as chain') @@ -105,6 +106,14 @@ class QueryController extends BaseController ->join('tab_game on tab_spend.game_id = tab_game.id') ->where($map) ->count(); + + $income = M('Spend', 'tab_') + ->field('sum(tab_spend.pay_amount) as income') + ->join('tab_game on tab_spend.game_id = tab_game.id') + ->join('left join tab_promote on tab_spend.promote_id = tab_promote.id') + ->where($map) + ->order('tab_spend.id desc') + ->find()['income']; } if (!empty($data)) { foreach ($data as &$list) { @@ -177,6 +186,7 @@ class QueryController extends BaseController } $this->assign('listData', $data); $this->assign('count', $count); + $this->assign('income', $income); $this->assign('initBegTime', $initBegTime); $this->assign('initEndTime', $initEndTime); $this->assign('setdate', date("Y-m-d")); @@ -1736,6 +1746,7 @@ class QueryController extends BaseController $records = []; $pagination = ''; $count = 0; + $total = []; if (intval($endTime - $begTime) / (24 * 3600) <= 31) { $map['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']; $ids = M('promote', 'tab_')->where($map)->getField('id', true); @@ -1824,6 +1835,11 @@ class QueryController extends BaseController $query = M()->alias('record') ->table($subQuery) ->order($orderBy); + $total = M('user_play_data_count', 'tab_')->alias('uc') + ->field($fieldUC) + ->join('tab_user_play_info as ui on ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id') + ->where($map) + ->find(); list($records, $pagination, $count) = $this->paginate($query); @@ -1839,6 +1855,7 @@ class QueryController extends BaseController $this->assign('records', $records); $this->assign('pagination', $pagination); $this->assign('count', $count); + $this->assign('total', $total); $this->assign('initBegTime', $initBegTime); $this->assign('initEndTime', $initEndTime); $this->assign('sort', $sort); diff --git a/Application/Home/View/default/Finance/settlementDtl.html b/Application/Home/View/default/Finance/settlementDtl.html index aefcaf46a..d438f9fca 100644 --- a/Application/Home/View/default/Finance/settlementDtl.html +++ b/Application/Home/View/default/Finance/settlementDtl.html @@ -164,11 +164,11 @@ {$vo.promote_account} {$vo.pay_amount} - 0 + 0.00 {$vo.pay_amount} {$vo.pay_amount} - 0 + 0.00 {$vo.selle_ratio}%|{$vo.selle_ratio}% {$vo.income} @@ -176,6 +176,24 @@ {$vo.selle_status} + + 合计} + -- + -- + -- + {$total.pay_amount} + + 0.00 + {$total.pay_amount} + + {$total.pay_amount} + 0.00 + + -- + {$total.income} + -- + -- + diff --git a/Application/Home/View/default/Query/recharge.html b/Application/Home/View/default/Query/recharge.html index d7a658ae1..b59d47b23 100644 --- a/Application/Home/View/default/Query/recharge.html +++ b/Application/Home/View/default/Query/recharge.html @@ -196,9 +196,9 @@ {$vo.game_name} {$vo.server_name} {$vo.game_player_name} - {$vo.p_p_pro_account}({$vo.p_p_pro_real_name}) - {$vo.p_pro_account}({$vo.p_pro_real_name}) - {$vo.pro_account}({$vo.pro_real_name}) + {$vo.p_p_pro_account}({$vo.p_p_pro_real_name}) + {$vo.p_pro_account}({$vo.p_pro_real_name}) + {$vo.pro_account}({$vo.pro_real_name}) {$vo.pay_time|date='Y-m-d H:i:s',###} @@ -206,6 +206,19 @@ + + 合计 + -- + -- + {$income} + -- + -- + -- + -- + -- + -- + -- + diff --git a/Application/Home/View/default/Query/userRecharges.html b/Application/Home/View/default/Query/userRecharges.html index 98b80d789..67a7f0889 100644 --- a/Application/Home/View/default/Query/userRecharges.html +++ b/Application/Home/View/default/Query/userRecharges.html @@ -167,6 +167,20 @@ {$record.promote_account} + + 合计 + -- + -- + -- + -- + -- + {$total.recharge_cost} + {$total.recharge_count} + {$total.recharge_cost_today} + -- + -- + -- +