diff --git a/Application/Admin/Controller/CompanyStatementPoolController.class.php b/Application/Admin/Controller/CompanyStatementPoolController.class.php index faec62a22..9638f2444 100644 --- a/Application/Admin/Controller/CompanyStatementPoolController.class.php +++ b/Application/Admin/Controller/CompanyStatementPoolController.class.php @@ -357,6 +357,7 @@ class CompanyStatementPoolController extends ThinkController } } } +// dump($infolist);die(); if($is_export){ $count["platform_amount"] = "=ROUND(SUM(K2:K".$line."),2)"; @@ -498,7 +499,6 @@ class CompanyStatementPoolController extends ThinkController $v['statement_money'] = "=ROUND("; } $handle_data = $this->changeDataStruct($v['statement_info'],$is_export,$week_line); -// dump($handle_data); $v['statement_info'] = $handle_data; $row = 0; foreach($v['statement_info'] as $ke=>&$va){ @@ -524,12 +524,9 @@ class CompanyStatementPoolController extends ThinkController //本周未结算流水合计 if(!$is_statement){ $count['pool_lack_count'] += $val['pay_amount']; - $count['st_lack_count'] += $val['sum_money']; if($is_export){ $this->setlackCount($line); } - }else{ - $count['st_count'] += $val['sum_money']; } } @@ -549,6 +546,12 @@ class CompanyStatementPoolController extends ThinkController $count['sum_money'] += $va['week_amount']; } + if(!$is_statement){ + $count['st_lack_count'] += $v['statement_money']; + }else{ + $count['st_count'] += $v['statement_money']; + } + $v['row'] = $row; if ($v['row'] == '0') { @@ -563,6 +566,7 @@ class CompanyStatementPoolController extends ThinkController } } } +// die(); if($is_export){ if($pool_info["withdraw_type"] != 3){ @@ -757,6 +761,9 @@ class CompanyStatementPoolController extends ThinkController $handle_data[$hk]['week_amount'] = "=ROUND(SUM(O{$old_line}:O{$week_line})+SUM(P{$old_line}:P{$week_line})-SUM(Q{$old_line}:Q{$week_line})-SUM(R{$old_line}:R{$week_line}),2)"; + if ($hk > 0) { + $handle_data[0]['week_amount'] = str_replace($old_line,$week_line,$handle_data[0]['week_amount']); + } if (count($hv['game_list'])>1) { @@ -1832,9 +1839,13 @@ class CompanyStatementPoolController extends ThinkController $lfine = 0; $handledata = []; -// dump($st);die(); - - +// dump($sum_money); +// dump($ratio); +// dump($refund); +// dump($withhold); +// dump($increment_ratio); +// dump($st); +//die(); foreach ($increment_ratio as $key => $value) { $statement_info = array(); @@ -1862,7 +1873,6 @@ class CompanyStatementPoolController extends ThinkController $statement_data = $model->where(['id'=>$key])->find(); - $statement_info = json_decode($statement_data['statement_info'],true); foreach ($statement_info as $k => $v) { @@ -1871,29 +1881,35 @@ class CompanyStatementPoolController extends ThinkController foreach ($game_list as $gk => $gv) { - if ($ratio[$key][$v['account']][$gk]) { - $statement_info[$k]['game_list'][$gk]['ratio'] = (int)$ratio[$key][$v['account']][$gk]; + if ($ratio[$key][$gv['game_name'].$gv['statement_begin_time'].'-'.$gv['statement_end_time'].$v['account']]) { + $statement_info[$k]['game_list'][$gk]['ratio'] = (int)$ratio[$key][$gv['game_name'].$gv['statement_begin_time'].'-'.$gv['statement_end_time'].$v['account']]; } - $statement_info[$k]['game_list'][$gk]['refund'] = $refund[$key][$v['account']][$gk]; - $statement_info[$k]['game_list'][$gk]['withhold'] = $withhold[$key][$v['account']][$gv['statement_begin_time']]; - $withhold[$key][$v['account']][$gv['statement_begin_time']] = 0; + $statement_info[$k]['game_list'][$gk]['refund'] = $refund[$key][$gv['game_name'].$gv['statement_begin_time'].'-'.$gv['statement_end_time'].$v['account']]; +// dump($gv['game_name'].$gv['statement_begin_time'].'-'.$gv['statement_end_time'].$v['account']); +// dump($withhold[$key][$gv['game_name'].$gv['statement_begin_time'].'-'.$gv['statement_end_time'].$v['account']][$gv['statement_begin_time']]); + $statement_info[$k]['game_list'][$gk]['withhold'] = $withhold[$key][$gv['game_name'].$gv['statement_begin_time'].'-'.$gv['statement_end_time'].$v['account']][$gv['statement_begin_time']]; + $withhold[$key][$gv['game_name'].$gv['statement_begin_time'].'-'.$gv['statement_end_time'].$v['account']][$gv['statement_begin_time']] = 0; - $statement_info[$k]['game_list'][$gk]['increment_ratio'] = $increment_ratio[$key][$v['account']][$gk]; + $statement_info[$k]['game_list'][$gk]['increment_ratio'] = $increment_ratio[$key][$gv['game_name'].$gv['statement_begin_time'].'-'.$gv['statement_end_time'].$v['account']]; - $statement_info[$k]['game_list'][$gk]['sum_money'] = $sum_money[$key][$v['account']][$gk]; + $statement_info[$k]['game_list'][$gk]['sum_money'] = $sum_money[$key][$gv['game_name'].$gv['statement_begin_time'].'-'.$gv['statement_end_time'].$v['account']]; - $amount += $sum_money[$key][$v['account']][$gk] - $statement_info[$k]['game_list'][$gk]['withhold']; + $amount += $sum_money[$key][$gv['game_name'].$gv['statement_begin_time'].'-'.$gv['statement_end_time'].$v['account']] - $statement_info[$k]['game_list'][$gk]['withhold']; if ($st[$key][$akey] == 1) { - $statement_amount += $sum_money[$key][$v['account']][$gk]-$statement_info[$k]['game_list'][$gk]['withhold']; + $statement_amount += $sum_money[$key][$gv['game_name'].$gv['statement_begin_time'].'-'.$gv['statement_end_time'].$v['account']]-$statement_info[$k]['game_list'][$gk]['withhold']; } else { - $statement_lack_amount += $sum_money[$key][$v['account']][$gk]-$statement_info[$k]['game_list'][$gk]['withhold']; + $statement_lack_amount += $sum_money[$key][$gv['game_name'].$gv['statement_begin_time'].'-'.$gv['statement_end_time'].$v['account']]-$statement_info[$k]['game_list'][$gk]['withhold']; } } } +// if ($key == 2312) { +// dump($statement_info); +// } + $statement_info_data = json_encode($statement_info); $r_data = $model->field("fine,reward")->where(['id'=>$key])->find(); @@ -1911,7 +1927,6 @@ class CompanyStatementPoolController extends ThinkController } - } //die(); M("company_statement_pool","tab_")->where(['id'=>$id])->save(['pay_amount'=>$statement_amount,'statement_money'=>$statement_amount+$reward-$fine,'lack_statement_money'=>$statement_lack_amount+$lreward-$lfine]); diff --git a/Application/Admin/View/CompanyStatementPool/editPuPool.html b/Application/Admin/View/CompanyStatementPool/editPuPool.html index cb44a615d..ee6569fe4 100644 --- a/Application/Admin/View/CompanyStatementPool/editPuPool.html +++ b/Application/Admin/View/CompanyStatementPool/editPuPool.html @@ -166,18 +166,18 @@