diff --git a/Application/Admin/Controller/CompanyStatementPoolController.class.php b/Application/Admin/Controller/CompanyStatementPoolController.class.php index b64383c74..badadd7d2 100644 --- a/Application/Admin/Controller/CompanyStatementPoolController.class.php +++ b/Application/Admin/Controller/CompanyStatementPoolController.class.php @@ -550,6 +550,7 @@ class CompanyStatementPoolController extends ThinkController } } } +// die(); if($is_export){ @@ -684,6 +685,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) { @@ -1759,9 +1763,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(); @@ -1789,7 +1797,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) { @@ -1798,29 +1805,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(); @@ -1838,7 +1851,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..fe4f57542 100644 --- a/Application/Admin/View/CompanyStatementPool/editPuPool.html +++ b/Application/Admin/View/CompanyStatementPool/editPuPool.html @@ -166,18 +166,18 @@ {$com['statement_info'][0]['time']} {$com['statement_info'][0]['game_list'][0]['pay_amount']} - - % - % + + % + % {$com['statement_info'][0]['game_list'][0]['sum_money']} - - + + {$com['statement_info'][0]['reward']||default="0"} {$com['statement_info'][0]['fine']||default="0"} - + {$com['statement_info'][0]['week_amount']} @@ -231,12 +231,12 @@ {$game['game_type_name']} {$game['pay_amount']} - - % - % + + % + % - {$game['sum_money']} - + {$game['sum_money']} + @@ -264,13 +264,13 @@ {$account['game_list'][0]['pay_amount']} - - % - % + + % + % {$account['game_list'][0]['sum_money']} - - + + @@ -280,7 +280,7 @@ - + {$account['week_amount']} @@ -309,12 +309,12 @@ {$game['pay_amount']} - - % - % + + % + % - {$game['sum_money']} - + {$game['sum_money']} +