diff --git a/Application/Admin/Controller/CompanyStatementPoolController.class.php b/Application/Admin/Controller/CompanyStatementPoolController.class.php index 30721e0d7..650bd69c6 100644 --- a/Application/Admin/Controller/CompanyStatementPoolController.class.php +++ b/Application/Admin/Controller/CompanyStatementPoolController.class.php @@ -357,6 +357,7 @@ class CompanyStatementPoolController extends ThinkController $count["platform_amount"] = "=ROUND(SUM(K2:K".$line."),2)"; $count["sum_money"] = "=ROUND(SUM(Q2:Q".$line."),2)"; } +// dump($infolist); $this->assign("data",$infolist); $this->assign("count",$count); $this->assign("is_export",$is_export); @@ -450,6 +451,7 @@ class CompanyStatementPoolController extends ThinkController $count["platform_amount"] = "=ROUND(SUM(K2:K".$line."),2)"; $count["sum_money"] = "=ROUND(SUM(Q2:Q".$line."),2)"; } +// dump($infolist); $this->assign("data",$infolist); $this->assign("count",$count); $this->assign("is_export",$is_export); @@ -595,6 +597,7 @@ class CompanyStatementPoolController extends ThinkController for ($i=0;;$i++) { if ($sv[$i]['sum_money']) { $game_data['week_amount'] += $sv[$i]['sum_money']; + $game_data['withhold_amount'] += $sv[$i]['withhold']; $game_data['fine'] += $sv[$i]['fine']; $game_data['reward'] += $sv[$i]['reward']; } else { @@ -634,6 +637,7 @@ class CompanyStatementPoolController extends ThinkController $handle_data[$hk-$substract]['time_row'] += $handle_data[$hk]['time_row']; $handle_data[$hk-$substract]['week_amount'] += $handle_data[$hk]['week_amount']; + $handle_data[$hk-$substract]['withhold_amount'] += $handle_data[$hk]['withhold_amount']; unset($handle_data[$hk]['time']); unset($handle_data[$hk]['time_row']); @@ -1584,7 +1588,10 @@ class CompanyStatementPoolController extends ThinkController } if ($info['withdraw_type'] == "特殊补点") { - $optist = ['viewPool','cancelPool','editSpecialPuPool']; + $optist = ['viewPool','cancelPool']; + if ($info['company_type'] == 2 && $info['verify_status'] == '0') { + array_push($optist,'editSpecialPuPool'); + } } if($info['company_type'] == 2 && $info['verify_status'] == '0'&&$info['withdraw_type'] != "特殊补点") { @@ -1668,50 +1675,60 @@ class CompanyStatementPoolController extends ThinkController $statement_amount = 0; $statement_lack_amount = 0; +// dump($increment_ratio); foreach ($increment_ratio as $key => $value) { - if ($st[$key] == 1) { - $model = M("company_statement_info","tab_"); - } else { - $model = M("company_lack_statement_info","tab_"); - } - $statement_data = $model->where(['id'=>$key])->find(); + $statement_info = array(); + foreach($value as $akey => $aval) { + + if ($st[$key][$akey] == 1) { + $model = M("company_statement_info","tab_"); + } else { + $model = M("company_lack_statement_info","tab_"); + } - $statement_info = json_decode($statement_data['statement_info'],true); + $statement_data = $model->where(['id'=>$key])->find(); - foreach ($statement_info as $k => $v) { + $statement_info = json_decode($statement_data['statement_info'],true); - $game_list = $v['game_list']; + foreach ($statement_info as $k => $v) { - foreach ($game_list as $gk => $gv) { - if ($ratio[$key][$v['account']][$gk]) { - $statement_info[$k]['game_list'][$gk]['ratio'] = $ratio[$key][$v['account']][$gk]; - } - $statement_info[$k]['game_list'][$gk]['refund'] = $refund[$key][$v['account']][$gk]; - $statement_info[$k]['game_list'][$gk]['withhold'] = $withhold[$key][$v['account']][$gk]; + $game_list = $v['game_list']; - $statement_info[$k]['game_list'][$gk]['increment_ratio'] = $increment_ratio[$key][$v['account']][$gk]; + foreach ($game_list as $gk => $gv) { - $statement_info[$k]['game_list'][$gk]['sum_money'] = $sum_money[$key][$v['account']][$gk]; + if ($ratio[$key][$v['account']][$gk]) { + $statement_info[$k]['game_list'][$gk]['ratio'] = (int)$ratio[$key][$v['account']][$gk]; + } + $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; - $amount += $sum_money[$key][$v['account']][$gk]; + $statement_info[$k]['game_list'][$gk]['increment_ratio'] = $increment_ratio[$key][$v['account']][$gk]; + + $statement_info[$k]['game_list'][$gk]['sum_money'] = $sum_money[$key][$v['account']][$gk]; + + $amount += $sum_money[$key][$v['account']][$gk]; + + if ($st[$key][$akey] == 1) { + $statement_amount += $sum_money[$key][$v['account']][$gk]; + } else { + $statement_lack_amount += $sum_money[$key][$v['account']][$gk]; + } - if ($st[$key] == 1) { - $statement_amount += $sum_money[$key][$v['account']][$gk]; - } else { - $statement_lack_amount += $sum_money[$key][$v['account']][$gk]; } -// dump($v['account']); -// dump($sum_money[$key][$v['account']][$gk]); + } - } + $statement_info_data = json_encode($statement_info); + + $model->where(['id'=>$key])->save(['statement_info'=>$statement_info_data,'statement_money'=>$amount,'pay_amount'=>$amount,'remark'=>$remark[$key]]); - $statement_info = json_encode($statement_info); + $amount = 0; + + } - $model->where(['id'=>$key])->save(['statement_info'=>$statement_info,'statement_money'=>$amount,'pay_amount'=>$amount,'remark'=>$remark[$key]]); - $amount = 0; } M("company_statement_pool","tab_")->where(['id'=>$id])->save(['pay_amount'=>$statement_amount,'statement_money'=>$statement_amount,'lack_statement_money'=>$statement_lack_amount]); diff --git a/Application/Admin/View/CompanyStatementPool/editPuPool.html b/Application/Admin/View/CompanyStatementPool/editPuPool.html index 17867b93c..b40ab82ba 100644 --- a/Application/Admin/View/CompanyStatementPool/editPuPool.html +++ b/Application/Admin/View/CompanyStatementPool/editPuPool.html @@ -171,10 +171,10 @@