diff --git a/Application/Admin/Controller/CompanyStatementOfflineController.class.php b/Application/Admin/Controller/CompanyStatementOfflineController.class.php index d24a39167..4a01c16c3 100644 --- a/Application/Admin/Controller/CompanyStatementOfflineController.class.php +++ b/Application/Admin/Controller/CompanyStatementOfflineController.class.php @@ -67,6 +67,7 @@ class CompanyStatementOfflineController extends ThinkController ->alias("c") ->field("c.*,p.statement_num,p.verify_status") ->where($map) + ->where(['p.verify_status'=>['neq',6]]) ->join("tab_company_statement_pool as p ON c.pool_id = p.id") diff --git a/Application/Admin/Controller/CompanyStatementPoolController.class.php b/Application/Admin/Controller/CompanyStatementPoolController.class.php index cf102db71..bb5f5f1a4 100644 --- a/Application/Admin/Controller/CompanyStatementPoolController.class.php +++ b/Application/Admin/Controller/CompanyStatementPoolController.class.php @@ -1,6 +1,7 @@ field("*,'1' as st")->where("pool_id = '{$id}'")->select(); //获取母单 - $pool_info = SM("company_statement_pool","tab_")->field('statement_num,create_lack_ids,verify_status,is_payment,withdraw_type,statement_begin_time,statement_end_time')->where("id={$id}")->find(); + $pool_info = SM("company_statement_pool","tab_") + ->field('statement_num,create_lack_ids,verify_status,is_payment,withdraw_type,statement_begin_time,statement_end_time,verify_log')->where("id={$id}")->find(); if(!empty($pool_info['create_lack_ids'])){ $l_ids = $pool_info['create_lack_ids']; $lack_info = SM("company_lack_statement_info","tab_")->field("*,'0' as st")->where("id in ({$l_ids})")->select(); $infolist =array_merge($infolist,$lack_info); } + if ($is_export) { + $symbol = "\n"; + } else { + $symbol = "
"; + } + + $pool_info['verify_log'] = json_decode($pool_info['verify_log'], true); + + if(isset($pool_info['verify_log']['firstverify_user'])){ + if($pool_info['verify_status'] == -3){ + $ts = "初审拒绝"; + }else{ + $ts = "初审通过"; + } + $pool_info["firstverify"]= "{$ts}({$pool_info['verify_log']['firstverify_user']}) {$symbol} {$pool_info['verify_log']['firstverify_time']}"; + $ts = ''; + }else{ + $pool_info["firstverify"] = '--'; + } + + if(isset($pool_info['verify_log']['verify_user'])){ + if($pool_info['verify_status'] == -1){ + $ts = "审核拒绝"; + }else{ + $ts = "审核通过"; + } + $pool_info["verify"]= "{$ts}({$pool_info['verify_log']['verify_user']}) {$symbol} {$pool_info['verify_log']['verify_time']}"; + }else{ + $pool_info["verify"] = '--'; + } + + + if(isset($pool_info['verify_log']['payment_user'])){ + if($pool_info['verify_status'] == -2){ + $ts = "拒绝打款"; + }elseif($pool_info['verify_status'] == 1){ + $ts = "打款信息确认"; + }elseif($pool_info['verify_status'] == 2){ + $ts = "待打款"; + }elseif($pool_info['verify_status'] == 3){ + $ts = "打款中"; + }elseif($pool_info['verify_status'] == 4){ + $ts="打款成功"; + }elseif($pool_info['verify_status'] == 5){ + $ts="无需打款"; + } + $pool_info["payment"]= "{$ts}({$pool_info['verify_log']['payment_user']}){$symbol} {$pool_info['verify_log']['payment_time']}"; + }else{ + $pool_info["payment"] = '--'; + } +// dump($pool_info);die(); + $statement_num = $pool_info['statement_num']; + $this->assign("pool_data",$pool_info); + $this->assign("title",$statement_num); + $this->assign("pool_status",$pool_info['verify_status']); + $this->assign("is_payment",$pool_info['is_payment']); + if($infolist[0]['company_type'] == 3){ + //上游 + $this->viewCpPool($infolist,$is_export); + }elseif($infolist[0]['company_type'] == 1){ + //下游公司 + $this->viewPcPool($infolist,$is_export); + }else{ + $this->viewPuPool($infolist,$is_export,$pool_info); + } + + } + + //查看 + public function viewUnPaymentPool() + { + if(!isset($_REQUEST['id'])){ + $this->error('参数错误'); + } + $id = $_REQUEST['id']; + $is_export= false; + if (isset($_REQUEST['export']) && $_REQUEST['export']==1){ + $is_export = true; + } + //获取基本信息 + $infolist = SM("company_statement_info","tab_")->field("*,'1' as st")->where("pool_id = '{$id}' and pay_status!=1")->select(); + //获取母单 + $pool_info = SM("company_statement_pool","tab_")->field('statement_num,create_lack_ids,verify_status,is_payment,withdraw_type,statement_begin_time,statement_end_time')->where("id={$id}")->find(); +// if(!empty($pool_info['create_lack_ids'])){ +// $l_ids = $pool_info['create_lack_ids']; +// $lack_info = SM("company_lack_statement_info","tab_")->field("*,'0' as st")->where("id in ({$l_ids})")->select(); +// $infolist =array_merge($infolist,$lack_info); +// } + +// dump($infolist);die(); + $statement_num = $pool_info['statement_num']; $this->assign("title",$statement_num); $this->assign("pool_status",$pool_info['verify_status']); @@ -241,6 +334,7 @@ class CompanyStatementPoolController extends ThinkController } + public function editPool() { if(!isset($_REQUEST['id'])){ $this->error('参数错误'); @@ -253,7 +347,7 @@ class CompanyStatementPoolController extends ThinkController //获取基本信息 $infolist = SM("company_statement_info","tab_")->field("*,'1' as st")->where("pool_id = '{$id}'")->select(); //获取母单 - $pool_info = SM("company_statement_pool","tab_")->field('statement_num,create_lack_ids,verify_status,is_payment,withdraw_type')->where("id={$id}")->find(); + $pool_info = SM("company_statement_pool","tab_")->field('statement_num,create_lack_ids,verify_status,is_payment,withdraw_type,company_type')->where("id={$id}")->find(); if(!empty($pool_info['create_lack_ids'])){ $l_ids = $pool_info['create_lack_ids']; $lack_info = SM("company_lack_statement_info","tab_")->field("*,'0' as st")->where("id in ({$l_ids})")->select(); @@ -261,13 +355,20 @@ class CompanyStatementPoolController extends ThinkController } $statement_num = $pool_info['statement_num']; + $this->assign("withdraw_type",$pool_info['withdraw_type']); $this->assign("title",$statement_num); $this->assign("pool_status",$pool_info['verify_status']); $this->assign("is_payment",$pool_info['is_payment']); if ($_REQUEST['type']) { $this->editSpecialPuPool($infolist,$is_export); } else { - $this->editPuPool($infolist,$is_export); + if($pool_info['company_type'] == 2) { + $this->editPuPool($infolist,$is_export); + } elseif($pool_info['company_type'] == 1) { + $this->editPcPool($infolist, $is_export); + } elseif($pool_info['company_type'] == 3) { + $this->editCpPool($infolist, $is_export); + } } } @@ -294,8 +395,6 @@ class CompanyStatementPoolController extends ThinkController $v['statement_money'] = "=ROUND("; } - - $handle_data = $this->changeDataStruct($v['statement_info'],$is_export,$week_line); $v['statement_info'] = $handle_data; @@ -307,13 +406,7 @@ class CompanyStatementPoolController extends ThinkController foreach($va['game_list'] as $key=>&$val){ $line ++; if($v['withdraw_type'] != 3) { -// if(!$val['ratio']&&!$val['increment_ratio']) { -// if(isset($val['ratio'])){ -// $val['increment_ratio'] = 0; -// }else{ -// $val['ratio'] = 0; -// } -// } + if (!$val['increment_ratio']) { $val['increment_ratio'] = 0; } @@ -325,11 +418,7 @@ class CompanyStatementPoolController extends ThinkController if (!$val['refund']) { $val['refund'] = 0; } -// if(isset($val['ratio'])){ -// $val['increment_ratio'] = 0; -// }else{ -// $val['ratio'] = 0; -// } + } if($is_export){ @@ -341,7 +430,6 @@ class CompanyStatementPoolController extends ThinkController $v['statement_money'] .= "N{$line}+"; }else{ $count['platform_amount'] += $val['pay_amount']; -// $count['sum_money'] += $val['sum_money']; } } @@ -357,19 +445,195 @@ class CompanyStatementPoolController extends ThinkController } } } -// dump($infolist);die(); if($is_export){ $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); $this->display("CompanyStatementPool/editPuPool"); } + //下游汇总结算查看 + public function editPcPool(&$infolist,$is_export){ + + $line = 1; + $count = []; + + foreach($infolist as $k=>&$v){ + + $v['statement_info'] = json_decode($v['statement_info'],true); + $v['company_info'] = json_decode($v['company_info'],true); + $v['statement_begin_time'] = date('Y.m.d',$v['statement_begin_time']); + $v['statement_end_time'] = date('Y.m.d',$v['statement_end_time']); + if( isset($v['verify_status'])){ + if( $v['verify_status'] ==2 ){ + $v['is_payment'] = 2; //不打款 + }else{ + $v['is_payment'] = 1; + } + } + + $cline = $line+1; + + $handle_data = $this->changeDataStructVc($v['statement_info'],$is_export,$cline); + $v['statement_info'] = $handle_data; +// dump($handle_data); + + foreach($v['statement_info'] as $ke=>&$va){ + $line ++; + + if($v['withdraw_type'] != 3) { + if (isset($va['ratio'])) { + $va['increment_ratio'] = 0; + } else { + $va['ratio'] = 0; + } + } + + if($is_export){ + + if($v['withdraw_type'] != 3) { + $va['d_statement_money'] = "=ROUND(D{$line}*(1-G{$line})*(E{$line}+F{$line}),2)"; + } else { + $va['d_statement_money'] = "=ROUND(D{$line}*(F{$line}),2)"; + } + }else{ + if ($v['withdraw_type'] != 3) { + $va['d_statement_money'] = round(($va['pay_amount']-$va['refund'])*($va['ratio']+$va['increment_ratio'])*(100-$va['fax_ratio'])/100/100,2); + + $count['platform_amount'] += $va['pay_amount']; + + $count['d_statement_money'] += $va['d_statement_money']; + } else { + $va['d_statement_money'] = round((($va['pay_amount']-$va['refund'])*($va['increment_ratio']))/100,2); + + $count['platform_amount'] += $va['pay_amount']; + + $count['d_statement_money'] += $va['d_statement_money']; + } + } + } + + $v['settlement_contact'] = $v['company_info']['link_man']; + + if($is_export){ + + if ($v['withdraw_type'] != 3) { + $v['statement_money'] = "=ROUND(SUM(H{$cline}:H{$line})+J{$cline}-I{$cline},2)"; + } + + }else{ + $count['fine'] += $v['fine']; + $count['reward'] += $v['reward']; + $count['statement_money'] += $v['statement_money']; + } + $v['statement_count'] = count($v['statement_info']); + if($v['statement_count'] == '0'){ + $v['statement_count'] = 1; + } + + } + if($is_export){ + $count["platform_amount"] = "=ROUND(SUM(D2:D".$line."),2)"; + $count["d_statement_money"] = "=ROUND(SUM(H2:H".$line."),2)"; + $count["fine"] = "=ROUND(SUM(I2:I".$line."),2)"; + $count["reward"] = "=ROUND(SUM(J2:J".$line."),2)"; + $count["statement_money"] = "=ROUND(SUM(K2:K".$line."),2)"; + } + + $this->assign("data",$infolist); + $this->assign("count",$count); + $this->assign("is_export",$is_export); + $this->display("CompanyStatementPool/editPcPool"); + + } + + //上游汇总查看及导出 + public function editCpPool(&$infolist,$is_export) + { + $line = 2; + $count = []; + //获取平台名 + $p_id = array_column($infolist,'company_id'); + $map['id'] = ['in',$p_id]; + $pl = M("Partner","tab_")->field("id,matche_platform")->where($map)->select(); + $Partner = []; + foreach($pl as $k=>$v){ + $Partner[$v['id']] = $v['matche_platform']; + } + unset($pl); + // + foreach($infolist as $k=>&$v){ + $v['statement_info'] = json_decode($v['statement_info'],true); + $v['company_info'] = json_decode($v['company_info'],true); + $v['statement_begin_time'] = date('Y.m.d',$v['statement_begin_time']); + $v['statement_end_time'] = date('Y.m.d',$v['statement_end_time']); + + if( isset($v['verify_status'])){ + if( $v['verify_status'] ==2 ){ + $v['is_payment'] = 2; //不打款 + }else{ + $v['is_payment'] = 1; + } + } + + $cline = $line+1; + + $handle_data = $this->changeDataStructCp($v['statement_info'],$is_export,$cline); + $v['statement_info'] = $handle_data; + + foreach($v['statement_info'] as $ke=>&$va){ + // dd($va); + $line ++; + $va['company_ratio'] = 100-$va['ratio']; + if($is_export){ + $va['d_statement_money'] = "=ROUND(F{$line}*(1-I{$line})*G{$line}*(1-J{$line}),2)";//=ROUND(F3*(1-I3)*G3*(1-J3),2) + }else{ + + $va['d_statement_money'] = round(($va['pay_amount']-$va['refund'])*(100-$va['promote_ratio'])*$va['ratio']*(100-$va['fax_ratio'])/1000000,2); + + $count['platform_amount'] += $va['pay_amount']; + $count['platform_amount2'] += $va['pay_amount']; + $count['d_statement_money'] += $va['d_statement_money']; + } + } + +// $handle_data = $this->changeDataStructVc($v['statement_info'],$is_export,$cline); +// $v['statement_info'] = $handle_data; +// dump($v['statement_info']); + + $v['matche_platform'] = $Partner[$v['company_id']]; + if($is_export){ + $v['statement_money'] = "=ROUND(SUM(K{$cline}:K{$line})+M{$cline}-L{$cline},2)"; + }else{ + $count['fine'] += $v['fine']; + $count['reward'] += $v['reward']; + $count['statement_money'] += $v['statement_money']; + $count['statement_money_s'] += $v['statement_money']; + } + $v['statement_count'] = count($v['statement_info']); + + } + if($is_export){ + $count["d_statement_money"] = "=ROUND(SUM(K3:K".$line."),2)"; + $count["platform_amount"] = "=ROUND(SUM(E3:E".$line."),2)"; + $count["platform_amount2"] = "=ROUND(SUM(F3:F".$line."),2)"; + $count["fine"] = "=ROUND(SUM(L3:L".$line."),2)"; + $count["reward"] = "=ROUND(SUM(M3:M".$line."),2)"; + $count["statement_money"] = "=ROUND(SUM(N3:N".$line."),2)"; + $count["statement_money_s"] = "=ROUND(SUM(N3:N".$line."),2)"; + } + // dd($infolist); + $this->assign("data",$infolist); + $this->assign("count",$count); + $this->assign("is_export",$is_export); + $this->display("CompanyStatementPool/editCpPool"); + } + public function editSpecialPuPool(&$infolist,$is_export) { $line = 1; $count = []; @@ -681,7 +945,7 @@ class CompanyStatementPoolController extends ThinkController $game_data['week_amount'] = 0; //周结算金额计算 for ($i=0;;$i++) { - if ($sv[$i]['sum_money']) { + if ($sv[$i]['sum_money']||$sv[$i]['sum_money']=='0') { $game_data['week_amount'] += $sv[$i]['sum_money']- $sv[$i]['withhold']+$sv[$i]['reward']-$sv[$i]['fine']; $game_data['withhold_amount'] += $sv[$i]['withhold']; $game_data['fine'] += $sv[$i]['fine']; @@ -765,26 +1029,248 @@ class CompanyStatementPoolController extends ThinkController $handle_data[0]['week_amount'] = str_replace($old_line,$week_line,$handle_data[0]['week_amount']); } - if (count($hv['game_list'])>1) { + if (count($hv['game_list'])>1) { + + $old_line += count($hv['game_list']); + + } else { + $old_line++; + } + + if(count($hv['game_list'])>1) { + + $week_line = $old_line ; + } else { + $week_line = $old_line; + } + + } + + } +// dump($handle_data); + return $handle_data?$handle_data:[]; + } + + public function changeDataStructVc($statement_info,$is_export = 0,$cline) { + $game_list = []; + $nline = $cline; + + //使用时间与会长账号作为键值分离数据 + foreach($statement_info as $sk=>$sv){ + + $sv['time'] = $sv['statement_begin_time'].'-'.$sv['statement_end_time']; + $game_list[$sv['statement_begin_time'].'-'.$sv['statement_end_time']][] = $sv; + + } + + $handle_data = []; + $substract = 1; + + //处理游戏金额数据 + foreach($game_list as $gk => $gv) { + + foreach ($gv as $lk => $lv){ + + if ($lk > 0) { + + for (;;) { + + if (!$handle_data[$lk-$substract]['time']) { +// $nline++; + $substract++; + } else { + $handle_data[$lk-$substract]['row'] += 1; + $handle_data[$lk-$substract]['week_amount'] += $lv['sum_money'] - $lv['withhold'] + $lv['reward'] - $lv['fine']; + +// if ($is_export) { +// $handle_data[$lk-$substract]['week_amount'] = "=ROUND(SUM(I{$cline}:I{$nline}),2)"; +// } + unset($lv['time']); + break; + } + + } + + } else { + + $lv['row'] = 1; + $lv['week_amount'] = $lv['sum_money'] - $lv['withhold'] + $lv['reward'] - $lv['fine']; +// $nline++; +// if ($is_export) { +// $lv['week_amount'] = "=ROUND(SUM(I{$cline}:I{$nline}),2)"; +// } + } + + array_push($handle_data,$lv); + + } + + } + + foreach($handle_data as $hk => $hv) { + $substract = 1; + if ($is_export) { +// dump($hv); + for (;;) { + + if (!$handle_data[$hk+$substract]['time']&&$handle_data[$hk+$substract]&&$hv['time']) { +// dump($handle_data[$hk+$substract]); + + $cline++; + $substract++; + } else { + break; + } + + } + +// if (count($handle_data)>1) { +// $cline += count($handle_data)-1; +// } + + if ($hv['time']&&$hk!=0) { + $nline =+ $cline+1; + $cline = $nline; + } + + $handle_data[$hk]['week_amount'] = "=ROUND(SUM(J{$nline}:J{$cline})-SUM(K{$nline}:K{$cline})+SUM(L{$nline}:L{$cline})-SUM(M{$nline}:M{$cline}),2)"; + +// if ($hk > 0) { +// $handle_data[0]['week_amount'] = str_replace($nline,$cline,$handle_data[0]['week_amount']); +// } + +// if (count($handle_data)>1) { +// +// $nline += count($handle_data); +// +// } else { +// $nline++; +// } +// +// if(count($handle_data)>1) { +// +// $cline = $nline ; +// } else { +// $cline = $nline; +// } + + } + + } +// die(); + + return $handle_data; + } + + public function changeDataStructCp($statement_info,$is_export = 0,$cline) { + $game_list = []; + $nline = $cline; + + //使用时间与会长账号作为键值分离数据 + foreach($statement_info as $sk=>$sv){ + + $sv['time'] = $sv['statement_begin_time'].'-'.$sv['statement_end_time']; + $game_list[$sv['statement_begin_time'].'-'.$sv['statement_end_time']][] = $sv; + + } + + $handle_data = []; + $substract = 1; + + //处理游戏金额数据 + foreach($game_list as $gk => $gv) { + + foreach ($gv as $lk => $lv){ + + if ($lk > 0) { + + for (;;) { + + if (!$handle_data[$lk-$substract]['time']) { +// $nline++; + $substract++; + } else { + $handle_data[$lk-$substract]['row'] += 1; + $handle_data[$lk-$substract]['week_amount'] += $lv['sum_money'] - $lv['withhold'] + $lv['reward'] - $lv['fine']; + +// if ($is_export) { +// $handle_data[$lk-$substract]['week_amount'] = "=ROUND(SUM(I{$cline}:I{$nline}),2)"; +// } + unset($lv['time']); + break; + } + + } + + } else { + + $lv['row'] = 1; + $lv['week_amount'] = $lv['sum_money'] - $lv['withhold'] + $lv['reward'] - $lv['fine']; +// $nline++; +// if ($is_export) { +// $lv['week_amount'] = "=ROUND(SUM(I{$cline}:I{$nline}),2)"; +// } + } + + array_push($handle_data,$lv); + + } + + } + + foreach($handle_data as $hk => $hv) { + $substract = 1; + if ($is_export) { +// dump($hv); + for (;;) { + + if (!$handle_data[$hk+$substract]['time']&&$handle_data[$hk+$substract]&&$hv['time']) { +// dump($handle_data[$hk+$substract]); + + $cline++; + $substract++; + } else { + break; + } + + } - $old_line += count($hv['game_list']); +// if (count($handle_data)>1) { +// $cline += count($handle_data)-1; +// } - } else { - $old_line++; + if ($hv['time']&&$hk!=0) { + $nline =+ $cline+1; + $cline = $nline; } - if(count($hv['game_list'])>1) { + $handle_data[$hk]['week_amount'] = "=ROUND(SUM(L{$nline}:L{$cline})-SUM(M{$nline}:M{$cline})+SUM(N{$nline}:N{$cline})-SUM(O{$nline}:O{$cline}),2)"; - $week_line = $old_line ; - } else { - $week_line = $old_line; - } +// if ($hk > 0) { +// $handle_data[0]['week_amount'] = str_replace($nline,$cline,$handle_data[0]['week_amount']); +// } + +// if (count($handle_data)>1) { +// +// $nline += count($handle_data); +// +// } else { +// $nline++; +// } +// +// if(count($handle_data)>1) { +// +// $cline = $nline ; +// } else { +// $cline = $nline; +// } } } -// dump($handle_data); - return $handle_data?$handle_data:[]; +// die(); + + return $handle_data; } //下游汇总结算查看 @@ -817,6 +1303,10 @@ class CompanyStatementPoolController extends ThinkController } } $cline = $line+1; + + $handle_data = $this->changeDataStructVc($v['statement_info'],$is_export,$cline); + $v['statement_info'] = $handle_data; + foreach($v['statement_info'] as $ke=>&$va){ $line ++; @@ -835,19 +1325,19 @@ class CompanyStatementPoolController extends ThinkController // $va['d_statement_money'] = "=ROUND(E{$line}*(G{$line}),2)"; // } if($v['withdraw_type'] != 3) { - $va['d_statement_money'] = "=ROUND(D{$line}*(1-G{$line})*(E{$line}+F{$line}),2)"; + $va['d_statement_money'] = "=ROUND((E{$line}-F{$line})*(1-I{$line})*(H{$line}+G{$line}),2)"; } else { - $va['d_statement_money'] = "=ROUND(D{$line}*(F{$line}),2)"; + $va['d_statement_money'] = "=ROUND((E{$line}-F{$line})*(1-I{$line})*(H{$line}),2)"; } }else{ if ($v['withdraw_type'] != 3) { - $va['d_statement_money'] = round($va['pay_amount']*($va['ratio']+$va['increment_ratio'])*(100-$va['fax_ratio'])/100/100,2); + $va['d_statement_money'] = round(($va['pay_amount']-$va['refund'])*($va['ratio']+$va['increment_ratio'])*(100-$va['fax_ratio'])/100/100,2); $count['platform_amount'] += $va['pay_amount']; $count['d_statement_money'] += $va['d_statement_money']; } else { - $va['d_statement_money'] = round(($va['pay_amount']*($va['increment_ratio']))/100,2); + $va['d_statement_money'] = round((($va['pay_amount']-$va['refund'])*($va['increment_ratio']))/100,2); $count['platform_amount'] += $va['pay_amount']; @@ -862,13 +1352,15 @@ class CompanyStatementPoolController extends ThinkController if ($v['withdraw_type'] != 3) { // $v['statement_money'] = "=ROUND(SUM(I{$cline}:I{$line})+K{$cline}-J{$cline},2)"; - $v['statement_money'] = "=ROUND(SUM(H{$cline}:H{$line})+J{$cline}-I{$cline},2)"; +// $v['statement_money'] = "=ROUND(SUM(H{$cline}:H{$line})+J{$cline}-I{$cline},2)"; + $v['statement_money'] = "=ROUND(SUM(N{$cline}:N{$line}),2)"; } }else{ $count['fine'] += $v['fine']; $count['reward'] += $v['reward']; $count['statement_money'] += $v['statement_money']; + $count["statement_money_s"] += $v['statement_money']; } $v['statement_count'] = count($v['statement_info']); if($v['statement_count'] == '0'){ @@ -877,11 +1369,12 @@ class CompanyStatementPoolController extends ThinkController } if($is_export){ - $count["platform_amount"] = "=ROUND(SUM(D2:D".$line."),2)"; - $count["d_statement_money"] = "=ROUND(SUM(H2:H".$line."),2)"; - $count["fine"] = "=ROUND(SUM(I2:I".$line."),2)"; - $count["reward"] = "=ROUND(SUM(J2:J".$line."),2)"; - $count["statement_money"] = "=ROUND(SUM(K2:K".$line."),2)"; + $count["platform_amount"] = "=ROUND(SUM(E2:E".$line."),2)"; + $count["d_statement_money"] = "=ROUND(SUM(J2:J".$line."),2)"; + $count["fine"] = "=ROUND(SUM(K2:K".$line."),2)"; + $count["reward"] = "=ROUND(SUM(L2:L".$line."),2)"; + $count["statement_money"] = "=ROUND(SUM(N2:N".$line."),2)"; + $count["statement_money_s"] = "=ROUND(SUM(O2:O".$line."),2)"; } // dd($infolist); $this->assign("data",$infolist); @@ -891,66 +1384,6 @@ class CompanyStatementPoolController extends ThinkController } - public function changeDataStructVc($statement_info,$is_export = 0,$cline) { - $game_list = []; - $nline = $cline; - - //使用时间与会长账号作为键值分离数据 - foreach($statement_info as $sk=>$sv){ - - $sv['time'] = $sv['statement_begin_time'].'-'.$sv['statement_end_time']; - $game_list[$sv['statement_begin_time'].'-'.$sv['statement_end_time']][] = $sv; - - } - - $handle_data = []; - $substract = 1; - - //处理游戏金额数据 - foreach($game_list as $gk => $gv) { - - foreach ($gv as $lk => $lv){ - - if ($lk > 0) { - - for (;;) { - - if (!$handle_data[$lk-$substract]['time']) { - $nline++; - $substract++; - } else { - $handle_data[$lk-$substract]['row'] += 1; - $handle_data[$lk-$substract]['week_amount'] += $lv['d_statement_money']; - - if ($is_export) { - $handle_data[$lk-$substract]['week_amount'] = "=ROUND(SUM(I{$cline}:I{$nline}),2)"; - } - unset($lv['time']); - break; - } - - } - - } else { - - $lv['row'] = 1; - $lv['week_amount'] = $lv['d_statement_money']; - $nline++; - if ($is_export) { - $lv['week_amount'] = "=ROUND(SUM(I{$cline}}:I{$nline}),2)"; - } - } - - array_push($handle_data,$lv); - - } - - } - - - return $handle_data; - } - //上游汇总查看及导出 public function viewCpPool(&$infolist,$is_export) { @@ -980,18 +1413,20 @@ class CompanyStatementPoolController extends ThinkController } } -// dump($v['statement_info']); - $cline = $line+1; + + $handle_data = $this->changeDataStructCp($v['statement_info'],$is_export,$cline); + $v['statement_info'] = $handle_data; + foreach($v['statement_info'] as $ke=>&$va){ // dd($va); $line ++; $va['company_ratio'] = 100-$va['ratio']; if($is_export){ - $va['d_statement_money'] = "=ROUND(F{$line}*(1-I{$line})*G{$line}*(1-J{$line}),2)";//=ROUND(F3*(1-I3)*G3*(1-J3),2) + $va['d_statement_money'] = "=ROUND((F{$line}-G{$line})*(1-J{$line})*H{$line}*(1-K{$line}),2)";//=ROUND(F3*(1-I3)*G3*(1-J3),2) }else{ - $va['d_statement_money'] = round($va['pay_amount']*(100-$va['promote_ratio'])*$va['ratio']*(100-$va['fax_ratio'])/1000000,2); + $va['d_statement_money'] = round(($va['pay_amount']-$va['refund'])*(100-$va['promote_ratio'])*$va['ratio']*(100-$va['fax_ratio'])/1000000,2); $count['platform_amount'] += $va['pay_amount']; $count['platform_amount2'] += $va['pay_amount']; @@ -1005,22 +1440,25 @@ class CompanyStatementPoolController extends ThinkController $v['matche_platform'] = $Partner[$v['company_id']]; if($is_export){ - $v['statement_money'] = "=ROUND(SUM(K{$cline}:K{$line})+M{$cline}-L{$cline},2)"; +// $v['statement_money'] = "=ROUND(SUM(K{$cline}:K{$line})+M{$cline}-L{$cline},2)"; + $v['statement_money'] = "=ROUND(SUM(P{$cline}:P{$line}),2)"; }else{ $count['fine'] += $v['fine']; $count['reward'] += $v['reward']; $count['statement_money'] += $v['statement_money']; + $count['statement_money_s'] += $v['statement_money']; } $v['statement_count'] = count($v['statement_info']); } if($is_export){ - $count["d_statement_money"] = "=ROUND(SUM(K3:K".$line."),2)"; + $count["d_statement_money"] = "=ROUND(SUM(L3:L".$line."),2)"; $count["platform_amount"] = "=ROUND(SUM(E3:E".$line."),2)"; $count["platform_amount2"] = "=ROUND(SUM(F3:F".$line."),2)"; - $count["fine"] = "=ROUND(SUM(L3:L".$line."),2)"; - $count["reward"] = "=ROUND(SUM(M3:M".$line."),2)"; - $count["statement_money"] = "=ROUND(SUM(N3:N".$line."),2)"; + $count["fine"] = "=ROUND(SUM(M3:M".$line."),2)"; + $count["reward"] = "=ROUND(SUM(N3:N".$line."),2)"; + $count["statement_money"] = "=ROUND(SUM(P3:P".$line."),2)"; + $count["statement_money_s"] = "=ROUND(SUM(Q3:Q".$line."),2)"; } // dd($infolist); $this->assign("data",$infolist); @@ -1515,7 +1953,7 @@ class CompanyStatementPoolController extends ThinkController $clsi = SM("company_lack_statement_info","tab_")->where("is_pool = 1 and id in ({$create_lack_ids})")->find(); $re_op = true; if(!empty($clsi)){ - $re_op = false; //被引用无法重算 +// $re_op = false; //被引用无法重算 } } if($re_op){ @@ -1714,23 +2152,36 @@ class CompanyStatementPoolController extends ThinkController $optist = ["viewPool","reCount","cancelPool"]; break; case '1': - $optist = ["viewPool","addRemark","viewRemark","editRemark","viewVoucher","editVoucher","uploadVoucher","editPayment","setUlPayment"]; + $optist = ["viewPool", +// "addRemark","viewRemark","editRemark", + "viewVoucher","editVoucher","uploadVoucher","editPayment","setUlPayment"]; break; case '2': - $optist = ["viewPool","addRemark","viewRemark","editRemark","viewVoucher","editVoucher","uploadVoucher"]; + $optist = ["viewPool", +// "addRemark","viewRemark","editRemark", + "viewVoucher","editVoucher","uploadVoucher"]; break; case '3': - $optist = ["viewPool","addRemark","viewRemark","editRemark","viewVoucher","editVoucher","uploadVoucher","viewPayment"]; + $optist = ["viewPool", +// "addRemark","viewRemark","editRemark", + "viewVoucher","editVoucher","uploadVoucher","viewPayment"]; break; case '4': - $optist = ["viewPool","addRemark","viewRemark","editRemark","viewVoucher","editVoucher","uploadVoucher","viewPayment"]; + $optist = ["viewPool", +// "addRemark","viewRemark","editRemark", + "viewVoucher","editVoucher","uploadVoucher","viewPayment"]; break; case '5': - $optist = ["viewPool","addRemark","viewRemark","editRemark","reCount","cancelPool"]; + $optist = ["viewPool", +// "addRemark","viewRemark","editRemark", + "reCount","cancelPool"]; break; case '6': - $optist = ["viewPool","addRemark","viewRemark","editRemark","reCount","cancelPool"]; + $optist = ["viewPool", +// "addRemark","viewRemark","editRemark", + "reCount","cancelPool"]; // ,"setPayment"]; + break; default: break; @@ -1762,7 +2213,7 @@ class CompanyStatementPoolController extends ThinkController } } - if($info['company_type'] == 2 && ($info['verify_status'] == '6' || $info['verify_status'] == '0') &&$info['withdraw_type'] != "特殊补点") { + if(($info['verify_status'] == '6' || $info['verify_status'] == '0') &&!($info['company_type'] == 2 && $info['withdraw_type'] == "特殊补点")) { array_push($optist,"editPool"); } @@ -1821,7 +2272,7 @@ class CompanyStatementPoolController extends ThinkController } return $resarr; } - + //编辑个人结算单 public function editCompanyStatementPool() { $data = $_POST; @@ -1855,7 +2306,7 @@ class CompanyStatementPoolController extends ThinkController // dump($increment_ratio); // dump($st); //die(); - foreach ($increment_ratio as $key => $value) { + foreach ($st as $key => $value) { $statement_info = array(); foreach($value as $akey => $aval) { @@ -1882,6 +2333,19 @@ class CompanyStatementPoolController extends ThinkController $statement_data = $model->where(['id'=>$key])->find(); + if ($statement_data['is_reward_fine_split'] == 1) { + $r_data = $model->field("fine,reward")->where(['id'=>$key])->find(); + if($model == SM("company_statement_info","tab_")) { + $reward += $r_data['reward']; + $fine += $r_data['fine']; + } else { + $lreward += $r_data['reward']; + $lfine += $r_data['fine']; + } + $model->where(['id'=>$key])->save(['remark'=>$remark[$key][$st[$key][$akey]]]); + break; + } + $statement_info = json_decode($statement_data['statement_info'],true); foreach ($statement_info as $k => $v) { @@ -1915,9 +2379,129 @@ class CompanyStatementPoolController extends ThinkController } -// if ($key == 2312) { -// dump($statement_info); -// } + $statement_info_data = json_encode($statement_info); + + $r_data = $model->field("fine,reward")->where(['id'=>$key])->find(); + if($model == SM("company_statement_info","tab_")) { + $reward += $r_data['reward']; + $fine += $r_data['fine']; + } else { + $lreward += $r_data['reward']; + $lfine += $r_data['fine']; + } + + $model->where(['id'=>$key])->save(['statement_info'=>$statement_info_data,'statement_money'=>$amount+($r_data['reward']?$r_data['reward']:0)-($r_data['fine']?$r_data['fine']:0),'pay_amount'=>$amount,'remark'=>$remark[$key][$st[$key][$akey]]]); + + $amount = 0; + + } + + } +//die(); + SM("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]); + + $this->ajaxReturn(['status'=>1,'info'=>'保存成功']); + + } + + //编辑公司结算单 + public function editCompanyStatementPoolPc() { + + $data = $_POST; + + if (!$data) { + $this->ajaxReturn(['status'=>0,'info'=>'数据错误']); + } + + $ratio = $data['ratio']; + $refund = $data['refund']; + $withhold = $data['withhold']; + $increment_ratio = $data['increment_ratio']; + $sum_money = $data['sum_money']; + $st = $data['st']; + $id = $data['id']; + $remark = $data['remark']; + + $amount = 0; + $statement_amount = 0; + $statement_lack_amount = 0; + $reward = 0; + $fine = 0; + $lreward = 0; + $lfine = 0; + + $handledata = []; +// dump($sum_money); +// dump($ratio); +// dump($refund); +// dump($withhold); +// dump($increment_ratio); +// dump($st); +//die(); + foreach ($st as $key => $value) { + + $statement_info = array(); + foreach($value as $akey => $aval) { + + if ($st[$key][$akey] == 1) { + $model = SM("company_statement_info","tab_"); + + if (!$handledata[$key][1]) { + $handledata[$key][1] = 1; + } else { + continue; + } + + + } else { + $model = SM("company_lack_statement_info","tab_"); + + if (!$handledata[$key][0]) { + $handledata[$key][0] = 1; + } else { + continue; + } + } + + $statement_data = $model->where(['id'=>$key])->find(); + + if ($statement_data['is_reward_fine_split'] == 1) { + $r_data = $model->field("fine,reward")->where(['id'=>$key])->find(); + if($model == SM("company_statement_info","tab_")) { + $reward += $r_data['reward']; + $fine += $r_data['fine']; + } else { + $lreward += $r_data['reward']; + $lfine += $r_data['fine']; + } + + $model->where(['id'=>$key])->save(['remark'=>$remark[$key][$st[$key][$akey]]]); + break; + } + + $statement_info = json_decode($statement_data['statement_info'],true); + + foreach ($statement_info as $k => $v) { + + if ($ratio[$key][$v['game_name'].$v['statement_begin_time']]) { + $statement_info[$k]['ratio'] = (int)$ratio[$key][$v['game_name'].$v['statement_begin_time'].'-'.$v['statement_end_time']]; + } + $statement_info[$k]['refund'] = $refund[$key][$v['game_name'].$v['statement_begin_time'].'-'.$v['statement_end_time']]; + + $statement_info[$k]['withhold'] = $withhold[$key][$v['game_name'].$v['statement_begin_time'].'-'.$v['statement_end_time']]; + $withhold[$key][$v['game_name'].$v['statement_begin_time'].'-'.$v['statement_end_time']] = 0; + + $statement_info[$k]['sum_money'] = $sum_money[$key][$v['game_name'].$v['statement_begin_time'].'-'.$v['statement_end_time']]; + + $amount += $sum_money[$key][$v['game_name'].$v['statement_begin_time'].'-'.$v['statement_end_time']] - $statement_info[$k]['withhold']; + + if ($st[$key][$akey] == 1) { + $statement_amount += $sum_money[$key][$v['game_name'].$v['statement_begin_time'].'-'.$v['statement_end_time']]-$statement_info[$k]['withhold']; + } else { + $statement_lack_amount += $sum_money[$key][$v['game_name'].$v['statement_begin_time'].'-'.$v['statement_end_time']]-$statement_info[$k]['withhold']; + } + + } $statement_info_data = json_encode($statement_info); @@ -2128,4 +2712,131 @@ class CompanyStatementPoolController extends ThinkController } } + public function splitRewardOrFailData() { + + if (!$_REQUEST['id']||!isset($_REQUEST['st'])) { + $this->ajaxReturn(['msg'=>'数据传输错误','status'=>'0']); + } + + $id = $_REQUEST['id']; + $st = $_REQUEST['st']; + + if ($st == 1) { + $model = SM("company_statement_info","tab_"); + + } else { + $model = SM("company_lack_statement_info","tab_"); + + } + + $info = $model + ->where(['id'=>$id]) + ->find(); + + $statement_info = json_decode($info['statement_info'],true); + +// $reward_data = []; +// $fine_data = []; + $handle_statement_data = []; + $settlementAmount = 0; + + if ($info['company_type'] == 2) { + + foreach ($statement_info as $key => $value) { + + $game_info = $value['game_list']; + $handle_statement_data[$key]['account'] = $value['account']; + + foreach ($game_info as $gkey => $gvalue) { + +// $time_key = $gvalue['statement_begin_time'].$gvalue['statement_end_time']; + + $handle_statement_data[$key]['game_list'][$gkey]['game_name'] = '--'; + $handle_statement_data[$key]['game_list'][$gkey]['game_type_name'] = '--'; + + $handle_statement_data[$key]['game_list'][$gkey]['statement_begin_time'] = $gvalue['statement_begin_time']; + $handle_statement_data[$key]['game_list'][$gkey]['statement_end_time'] = $gvalue['statement_end_time']; + $handle_statement_data[$key]['game_list'][$gkey]['reward'] = $gvalue['reward']; + $handle_statement_data[$key]['game_list'][$gkey]['fine'] = $gvalue['fine']; + + $handle_statement_data[$key]['game_list'][$gkey]['pay_amount'] = 0; + $handle_statement_data[$key]['game_list'][$gkey]['all_pay_amount'] = 0; + $handle_statement_data[$key]['game_list'][$gkey]['sum_money'] = 0; + + $statement_info[$key]['game_list'][$gkey]['reward'] = 0; + $statement_info[$key]['game_list'][$gkey]['fine'] = 0; + + $settlementAmount += $gvalue['reward']-$gvalue['fine']; + + } + + } + + } else { + + foreach ($statement_info as $key => $value) { + + $handle_statement_data[$key]['game_name'] = '--'; + $handle_statement_data[$key]['game_type_name'] = '--'; + + $handle_statement_data[$key]['statement_begin_time'] = $value['statement_begin_time']; + $handle_statement_data[$key]['statement_end_time'] = $value['statement_end_time']; + $handle_statement_data[$key]['reward'] = $value['reward']; + $handle_statement_data[$key]['fine'] = $value['fine']; + + $handle_statement_data[$key]['pay_amount'] = 0; + $handle_statement_data[$key]['all_pay_amount'] = 0; + $handle_statement_data[$key]['sum_money'] = 0; + + $statement_info[$key]['reward'] = 0; + $statement_info[$key]['fine'] = 0; + + $settlementAmount += $value['reward']-$value['fine']; + + } + + } +// dump($reward_data); +// dump($fine_data); +// die(); + if (!$handle_statement_data) { + $this->ajaxReturn(['msg'=>'没有奖罚数据','status'=>'0']); + } + + if ($settlementAmount <= 0) { + $this->ajaxReturn(['msg'=>'奖罚结算小于等于0,不分离','status'=>'0']); + } + + $save['pool_id'] = $info['pool_id']?$info['pool_id']:$_REQUEST['pool_id']; + $save['company_id'] = $info['company_id']; + $save['company_type'] = $info['company_type']; + $save['company_name'] = $info['company_name']; + $save['company_info'] = $info['company_info']; + $save['statement_begin_time'] = $info['statement_begin_time']; + $save['statement_end_time'] = $info['statement_end_time']; + $save['statement_num'] = "JS_" . date("YmdHis", time()) . $info['company_id'] . sp_random_string(5); + $save['withdraw_type'] = $info['withdraw_type']; + $save['verify_status'] = $info['verify_status']; + + $save['statement_money'] = $settlementAmount; + $save['pay_amount'] = $settlementAmount; + $save['platform_amount'] = $settlementAmount; + $save['is_reward_fine_split'] = 1; + + $handle_statement_data = json_encode($handle_statement_data); + + //罚款数据 + $save['statement_info'] = $handle_statement_data; + $save['reward'] = $info['reward']; + $save['fine'] = $info['fine']; + + //罚款新增 + SM("company_statement_info","tab_")->add($save); + + $model->where(['id'=>$id])->save(['reward'=>0,'fine'=>0,'statement_info'=>json_encode($statement_info),'statement_money'=>$info['statement_money']-$settlementAmount,'pay_amount'=>$info['pay_amount']-$settlementAmount]); + + $this->ajaxReturn(['msg'=>'执行成功','status'=>'1']); + + } + } diff --git a/Application/Admin/Controller/CompanyStatementSetController.class.php b/Application/Admin/Controller/CompanyStatementSetController.class.php index b3c5ed1d1..ecd82bd39 100644 --- a/Application/Admin/Controller/CompanyStatementSetController.class.php +++ b/Application/Admin/Controller/CompanyStatementSetController.class.php @@ -263,7 +263,7 @@ class CompanyStatementSetController extends Controller { $statement_end_time = date("Y.m.d",$endtime); foreach($cpList as $k=>$v){ $add_data=[]; - + $handleed_data = []; //1.获取甲乙方信息 if($v['first_company_type'] == 1){ //甲方上游 @@ -351,6 +351,22 @@ class CompanyStatementSetController extends Controller { $game['statement_begin_time']=$statement_begin_time; $game['statement_end_time']=$statement_end_time; $game['statement_type']=0; + + $RewardRecordRes = $this->getPromoteUserGameRewardRecordCp($add_data['company_id'],$statement_begin_time,$statement_end_time); + + if ( + ($handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] || $handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] == '0') + || ($handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] || $handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] == '0') + ) { + $game['fine'] = 0; + $game['reward'] = 0; + } else { + $game['fine'] = $RewardRecordRes['fine']?$RewardRecordRes['fine']:0; + $game['reward'] = $RewardRecordRes['reward']?$RewardRecordRes['reward']:0; + $handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] = (string)$RewardRecordRes['fine']; + $handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] = (string)$RewardRecordRes['reward']; + } + $add_data['statement_info'][] = $game; } }else{ @@ -710,6 +726,9 @@ class CompanyStatementSetController extends Controller { if(!isset($v['game_list'])){continue;} //获取多段比例 $game_ratio_list = D("CompanyGameRatio")->getPromoteCompanyGameRatio($add_data['company_id'],$v['game_ids'],$begintime,$endtime,$company_belong); + + $handleed_data = []; + foreach ($game_ratio_list as $t_game_id => $t_game_ratio) { $game =[]; $game['game_name'] =$v['game_list'][$t_game_id]['game_name']; @@ -774,6 +793,21 @@ class CompanyStatementSetController extends Controller { $game['ratio']=$tratio; } + $RewardRecordRes = $this->getPromoteUserGameRewardRecord($add_data['company_id'],$statement_begin_time,$statement_end_time); + + if ( + ($handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] || $handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] == '0') + || ($handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] || $handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] == '0') + ) { + $game['fine'] = 0; + $game['reward'] = 0; + } else { + $game['fine'] = $RewardRecordRes['fine']?$RewardRecordRes['fine']:0; + $game['reward'] = $RewardRecordRes['reward']?$RewardRecordRes['reward']:0; + $handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] = (string)$RewardRecordRes['fine']; + $handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] = (string)$RewardRecordRes['reward']; + } + $game['sum_money']=round($game['pay_amount']*$tratio*(100-$fax_ratio)/(100*100),2);//结算金额=平台总额*(分成比例+补点比例)*(1-税费费率) $add_data['statement_money'] += $game['sum_money']; if ($game['pay_amount'] != '0') { @@ -826,6 +860,22 @@ class CompanyStatementSetController extends Controller { }else{ $temp_game['ratio']=$tratio; } + + $RewardRecordRes = $this->getPromoteUserGameRewardRecord($add_data['company_id'],$temp_game['statement_begin_time'],$temp_game['statement_end_time']); + + if ( + ($handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] || $handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] == '0') + || ($handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] || $handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] == '0') + ) { + $game['fine'] = 0; + $game['reward'] = 0; + } else { + $game['fine'] = $RewardRecordRes['fine']?$RewardRecordRes['fine']:0; + $game['reward'] = $RewardRecordRes['reward']?$RewardRecordRes['reward']:0; + $handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] = (string)$RewardRecordRes['fine']; + $handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] = (string)$RewardRecordRes['reward']; + } + $temp_game['sum_money']=round($temp_game['pay_amount']*$tratio*(100-$fax_ratio)/(100*100),2);//结算金额=平台总额*(分成比例+补点比例)*(1-税费费率) $add_data['statement_money'] += $temp_game['sum_money']; if ($temp_game['pay_amount'] != '0') { @@ -2081,6 +2131,41 @@ class CompanyStatementSetController extends Controller { } } + /** + * 获取上游游戏奖罚 + */ + protected function getPromoteUserGameRewardRecordCp($cpmpamy_id,$begintime,$endtime) + { + + $begintime = strtotime(str_replace('.','-',$begintime)); + $endtime = strtotime(str_replace('.','-',$endtime))+86499; + + //获取所有公司的奖罚 + $rrmap = array( + "d.confirm_time" => ['between', [$begintime,$endtime]], + "d.company_type"=>1, + "d.company_id"=>$cpmpamy_id, + "d.settlement_type"=>2, +// "relation_game_id"=>$relation_game_id, + ); + + $rfres = M("RewardDetail","tab_") + ->alias("d") + ->field(" + IFNULL(SUM(CASE WHEN type = 1 THEN amount ELSE 0 END),0) as reward, + IFNULL(SUM(CASE WHEN type = 2 THEN amount ELSE 0 END),0) as fine") + ->join('tab_reward_record as r on d.record_id = r.id', 'LEFT') + ->where($rrmap) + ->group("company_id") + ->find(); + + if(empty($rfres)){ + return false; + }else{ + return $rfres; + } + } + /** * 获取公司奖罚 */ diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 39cce7e7b..ea63a7dae 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -5654,6 +5654,7 @@ class ExportController extends Controller $xlsCell = array( array('uid','账号ID'), array('nickname','管理员账号'), + array('real_name','真实姓名'), array('group_name','角色类型'), array('login','登录次数'), array('last_login_time','最后登录时间'), @@ -5666,6 +5667,11 @@ class ExportController extends Controller }else{ $map['nickname'] = array('like', '%'.(string)$nickname.'%'); } + + if(isset($_REQUEST['real_name'])) { + $map['real_name'] = $_REQUEST['real_name']; + } + if(isset($_REQUEST['status'])){ $map['status'] = $_REQUEST['status']; } diff --git a/Application/Admin/Controller/MarketPercentageController.class.php b/Application/Admin/Controller/MarketPercentageController.class.php index 77f8e064d..eb0c218e8 100644 --- a/Application/Admin/Controller/MarketPercentageController.class.php +++ b/Application/Admin/Controller/MarketPercentageController.class.php @@ -3,6 +3,7 @@ namespace Admin\Controller; use User\Api\UserApi as UserApi; +use Base\Factory\BaseFactory; /** * 后台首页控制器 @@ -12,6 +13,9 @@ class MarketPercentageController extends ThinkController { protected $coefficient = []; + //实例化离职服务类 + private $leavePercentage; + private $unSettlementList; protected function _initialize() { @@ -23,6 +27,13 @@ class MarketPercentageController extends ThinkController $this->coefficient[$value['pay_time']][$value['admin_id']] = $value['coefficient'] / 100; } + + $instance = BaseFactory::getInstance(); + $this->leavePercentage = $instance->factoryClass("LeavePercentage"); + //不结算列表 + $this->leavePercentage->unSettlementList(); + $this->unSettlementList = $this->leavePercentage->returnUnSettlementList(); + parent::_initialize(); } @@ -582,28 +593,28 @@ class MarketPercentageController extends ThinkController if (is_administrator() || session('user_group_id') == 15 || session('user_group_id') == 14 || session('user_group_id') == 19 || session('user_group_id') == 23) { unset($map['admin_id']); - $markerData = M("ucenter_member")->field("id")->where(['work_status' => 1])->select(); - - if ($markerData) { - $admin_map['sys_member.uid'] = ['not in', array_column($markerData, 'id')]; - } +// $markerData = M("ucenter_member")->field("id")->where(['work_status' => 1])->select(); +// +// if ($markerData) { +// $admin_map['sys_member.uid'] = ['not in', array_column($markerData, 'id')]; +// } $admin_data = M("member") ->field("access.uid admin_id") ->join("left join sys_auth_group_access access on sys_member.uid = access.uid") ->join("left join sys_auth_group auth on access.group_id=auth.id") ->where(['group_id' => ['in', '11,12,21']]) - ->where($admin_map) +// ->where($admin_map) ->select(); if ($admin_data) { $map['admin_id'] = ['in', array_column($admin_data, 'admin_id')]; } - if (!in_array($_REQUEST['admin_id'], array_column($markerData, 'id'))) { +// if (!in_array($_REQUEST['admin_id'], array_column($markerData, 'id'))) { $_REQUEST['admin_id'] ? ($map['admin_id'] = $_REQUEST['admin_id']) : ''; - } else { - $this->display("marketstaffsettle"); - die(); - } +// } else { +// $this->display("marketstaffsettle"); +// die(); +// } } @@ -737,6 +748,12 @@ class MarketPercentageController extends ThinkController continue; } } +// dump($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id'])); + //离职结算判断 + !($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?$data[$key]['achievement_bonus']=0:''; + if ($this->unSettlementList[$value['admin_id']]&&date("Y-m",$this->unSettlementList[$value['admin_id']])<=$value['pay_time']) { + $data[$key]['leave_time'] = date("Y-m-d",$this->unSettlementList[$value['admin_id']]); + } $data[$key]['start_time'] = date("Y-m-1", strtotime($value['pay_time'])); $data[$key]['end_time'] = date("Y-m-t", strtotime($value['pay_time'])); @@ -1172,6 +1189,8 @@ class MarketPercentageController extends ThinkController $value['company_profit'] = "0.00"; } + !($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?$data[$key]['achievement_bonus']=0:''; + $data[$key]['coefficient'] = $this->coefficient[$value['pay_time']][$value['admin_id']] ? $this->coefficient[$value['pay_time']][$value['admin_id']] : 1; $data[$key]['wait_commission'] = @@ -1409,15 +1428,16 @@ class MarketPercentageController extends ThinkController $data = SM("market_altogether", "tab_") ->field("max(tab_market_altogether.pay_time) pay_time,tab_market_altogether.real_name,tab_market_altogether.admin_id,tab_market_altogether.nickname,level,sum(pay_amount) pay_amount,sum(extend_commission) extend_commission, - sum(performance_commission) performance_commission,sum(achievement_bonus* IF(coefficient is not NULL, coefficient, 100)/100) achievement_bonus, + sum(performance_commission) performance_commission,IF(leave_time!=0 and unix_timestamp(now())-leave_time>86400*30,0,sum(achievement_bonus* IF(coefficient is not NULL, coefficient, 100)/100)) achievement_bonus, sum(wait_performance_commission)+sum(wait_achievement_commission) wait_amount, - sum(if(status > 0, wait_performance_commission, '0.00')) + sum(if(status > 0, wait_achievement_commission,'0.00') * IF(coefficient is not NULL, coefficient, 100)/100 ) wait_extend_commission, - sum(if(status = 0, wait_performance_commission, '0.00')) + round(sum(if(status = 0, wait_achievement_commission,'0.00') * IF(coefficient is not NULL, coefficient, 100)/100),2) wait_commission, remark,status") + sum(if(tab_market_altogether.status > 0, wait_performance_commission, '0.00')) + sum(if(tab_market_altogether.status > 0, wait_achievement_commission,'0.00') * IF(coefficient is not NULL, coefficient, 100)/100 ) wait_extend_commission, + sum(if(tab_market_altogether.status = 0, wait_performance_commission, '0.00')) + round(sum(if(tab_market_altogether.status = 0, wait_achievement_commission,'0.00') * IF(coefficient is not NULL, coefficient, 100)/100),2) wait_commission, remark,tab_market_altogether.status") ->where($map); if ($_REQUEST['export']) { $data = $data ->join("left join tab_coefficient on tab_market_altogether.admin_id=tab_coefficient.admin_id and tab_coefficient.pay_time=tab_market_altogether.pay_time") + ->join("left join sys_ucenter_member on tab_market_altogether.admin_id=sys_ucenter_member.id") ->order("tab_market_altogether.pay_time DESC,company_profit DESC") ->group("tab_market_altogether.admin_id,tab_market_altogether.pay_time") ->select(false); @@ -1425,6 +1445,7 @@ class MarketPercentageController extends ThinkController $data = $data // ->page($p, $row) ->join("left join tab_coefficient on tab_market_altogether.admin_id=tab_coefficient.admin_id and tab_coefficient.pay_time=tab_market_altogether.pay_time") + ->join("left join sys_ucenter_member on tab_market_altogether.admin_id=sys_ucenter_member.id") ->order("tab_market_altogether.pay_time DESC,company_profit DESC") ->group("tab_market_altogether.admin_id,tab_market_altogether.pay_time") ->select(false); diff --git a/Application/Admin/Controller/TimingController.class.php b/Application/Admin/Controller/TimingController.class.php index 5f50f2acc..b500187f7 100644 --- a/Application/Admin/Controller/TimingController.class.php +++ b/Application/Admin/Controller/TimingController.class.php @@ -10,6 +10,7 @@ namespace Admin\Controller; use User\Api\UserApi as UserApi; use function GuzzleHttp\Psr7\str; +use Base\Factory\BaseFactory; /** * 后台首页控制器 @@ -1545,4 +1546,13 @@ class TimingController extends AdminController { } + //离职定时器 + public function timingleaveMarketMember() { + + $instance = BaseFactory::getInstance(); + $leavePercentageInstance = $instance->factoryClass("LeavePercentage"); + + $leavePercentageInstance->leaveTiming(); + } + } diff --git a/Application/Admin/Controller/UserController.class.php b/Application/Admin/Controller/UserController.class.php index 6d3013b5f..c935e31fa 100644 --- a/Application/Admin/Controller/UserController.class.php +++ b/Application/Admin/Controller/UserController.class.php @@ -31,6 +31,11 @@ class UserController extends AdminController if (isset($_REQUEST['status'])) { $map['status'] = $_REQUEST['status']; } + + if(isset($_REQUEST['real_name'])) { + $map['real_name'] = $_REQUEST['real_name']; + } + if (is_numeric($nickname)) { $map['uid|nickname'] = array(intval($nickname), array('like', '%' . $nickname . '%'), '_multi' => true); } else { @@ -389,6 +394,22 @@ class UserController extends AdminController } } + if (strtotime($_POST['apply_leave_time'])error('申请离职时间不能早于当前时间!'); + } + + if (strtotime($_POST['leave_time'])error('离职时间不能早于当前时间!'); + } + + if (strtotime($_POST['apply_leave_time'])>strtotime($_POST['leave_time'])) { + $this->error('申请离职时间不得晚于离职时间!'); + } + + if ((strtotime($_POST['apply_leave_time'])&&!strtotime($_POST['leave_time']))||!strtotime($_POST['apply_leave_time'])&&strtotime($_POST['leave_time'])) { + $this->error('申请离职时,申请离职时间与离职时间都必须填写!'); + } + $group = M('auth_group', 'sys_')->where(['id' => I('auth')])->find(); if (is_null($group)) { $this->error('角色类型不存在!'); @@ -430,6 +451,8 @@ class UserController extends AdminController $info['second_pwd'] = (empty($spwd) || $spwd == $oldspwd) ? $oldspwd : $spwd; $info['email'] = $_POST['email']; $info['mobile'] = isset($_POST['mobile']) ? $_POST['mobile'] : ''; + $_POST['apply_leave_time'] ? ($info['apply_leave_time'] = strtotime($_POST['apply_leave_time'])):''; + $_POST['leave_time'] ? ($info['leave_time'] = strtotime($_POST['leave_time'])+86399):''; if($_POST['work_status']) { $info['work_status'] = $_POST['work_status']; } @@ -463,6 +486,9 @@ class UserController extends AdminController $map['id'] = $_GET['id']; $Member = D('UcenterMember')->where($map)->find(); + $Member['apply_leave_time']?($Member['apply_leave_time'] = date("Y-m-d",$Member['apply_leave_time'])):($Member['apply_leave_time']=''); + $Member['leave_time']?($Member['leave_time'] = date("Y-m-d",$Member['leave_time'])):($Member['leave_time']=''); + $data = D('Member')->where(array('uid' => $_GET['id']))->find(); $au = D('AuthGroupAccess')->where(array('uid' => $_GET['id']))->find(); diff --git a/Application/Admin/Model/ModelModel.class.php b/Application/Admin/Model/ModelModel.class.php index b54e2e186..8d628dd5e 100644 --- a/Application/Admin/Model/ModelModel.class.php +++ b/Application/Admin/Model/ModelModel.class.php @@ -86,7 +86,7 @@ class ModelModel extends Model{ return empty($fields) ? '' : json_encode($fields); } - protected function getAttribute($fields) { + protected function getAttribute($fields="") { return empty($fields) ? '' : implode(',', $fields); } diff --git a/Application/Admin/View/CompanyStatementPool/editCpPool.html b/Application/Admin/View/CompanyStatementPool/editCpPool.html new file mode 100644 index 000000000..a2cd84264 --- /dev/null +++ b/Application/Admin/View/CompanyStatementPool/editCpPool.html @@ -0,0 +1,690 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
合作公司平台结算日期产品平台流水未结算平台流水退款分成比例渠道费率税费费率合作方待结算分成违规罚款奖励其他扣款周期结算金额合作待结算金额是否结算是否支付宝打款账户信息备注操作
合作方我方户名账号开户行
{$com.company_name}{$com.matche_platform}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['pay_amount']}{$com['statement_info'][0]['pay_amount']} + + + + + 0 + + + {$com['statement_info'][0]['ratio']|showNumPercent} + + + + {$com['statement_info'][0]['company_ratio']|showNumPercent}{$com['statement_info'][0]['promote_ratio']|showNumPercent} + {$com['statement_info'][0]['fax_ratio']|showNumPercent} + + + + + {$com['statement_info'][0]['d_statement_money']} + + + {$com['fine']-0}{$com['reward']-0} + + + + + 0 + + + {$com['statement_info'][0]['week_amount']} + {$com['statement_money']}{$com.company_info.payee_name} {$com.company_info.bank_account}{$com.company_info.opening_bank}{$com.company_info.ali_user}{$com.company_info.ali_account} + + 不结算 + + + 奖惩分离 + +
{$it['time']}{$it['game_name']}{$it['pay_amount']}{$it['pay_amount']} + + + + 0 + + + {$it['ratio']|showNumPercent} + + + + {$it['company_ratio']|showNumPercent}{$it['promote_ratio']|showNumPercent} + {$it['fax_ratio']|showNumPercent} + + + + + {$it['d_statement_money']} + + + {$it['fine']-0}{$it['reward']-0} + + + + + 0 + + {$it['week_amount']}
合计:{$count.platform_amount}{$count.platform_amount2}{$count.d_statement_money}{$count.fine}{$count.reward}{$count.statement_money}{$count.statement_money}
+ +
+ {$pool_data.firstverify} +
+ +
+ {$pool_data.firstverify} +
+
+
+ +
+ {$pool_data.verify} +
+ +
+ {$pool_data.verify} +
+
+
+ +
+ {$pool_data.payment} +
+ +
+ {$pool_data.payment} +
+
+
+ +
+
+ + +
+ +
+
+ + + diff --git a/Application/Admin/View/CompanyStatementPool/editPcPool.html b/Application/Admin/View/CompanyStatementPool/editPcPool.html new file mode 100644 index 000000000..2904af6af --- /dev/null +++ b/Application/Admin/View/CompanyStatementPool/editPcPool.html @@ -0,0 +1,687 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
序号公司名称结算日期合作产品名称平台总额(元)退款下游内团分成比例补点比例税费费率分成金额/元罚款奖励其他扣款周期结算金额合计/元对账人户名帐号开户行是否支付宝打款是否结算备注操作
{$key-0+1}{$com.company_name}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['pay_amount']} + + + + 0 + + + {$com['statement_info'][0]['ratio']|showNumPercent} + + + + + {$com['statement_info'][0]['increment_ratio']|showNumPercent} + + + + + {$com['statement_info'][0]['fax_ratio']|showNumPercent} + + + + + {$com['statement_info'][0]['d_statement_money']} + + + {$com['statement_info'][0]['fine']-0}{$com['statement_info'][0]['reward']-0} + + + + + 0 + + + {$com['statement_info'][0]['week_amount']} + + {$com['statement_money']} + {$com.settlement_contact}{$com.company_info.payee_name} {$com.company_info.bank_account}{$com.company_info.opening_bank}{$com.company_info.ali_user}{$com.company_info.ali_account} + + 不结算 + + + 奖惩分离 + +
{$it['time']}{$it['game_name']}{$it['pay_amount']} + + + + 0 + + + {$it['ratio']|showNumPercent} + + + + + {$it['increment_ratio']|showNumPercent} + + + + + {$it['fax_ratio']|showNumPercent} + + + + + {$it['d_statement_money']} + + + {$it['fine']-0}{$it['reward']-0} + + + + + 0 + + {$it['week_amount']}
合计:{$count.platform_amount}{$count.d_statement_money}{$count.fine}{$count.reward}{$count.statement_money}{$count.statement_money}
+ +
+ {$pool_data.firstverify} +
+ +
+ {$pool_data.firstverify} +
+
+
+ +
+ {$pool_data.verify} +
+ +
+ {$pool_data.verify} +
+
+
+ +
+ {$pool_data.payment} +
+ +
+ {$pool_data.payment} +
+
+
+ +
+
+ + +
+ +
+
+ + + diff --git a/Application/Admin/View/CompanyStatementPool/editPuPool.html b/Application/Admin/View/CompanyStatementPool/editPuPool.html index ee6569fe4..90bc0dee3 100644 --- a/Application/Admin/View/CompanyStatementPool/editPuPool.html +++ b/Application/Admin/View/CompanyStatementPool/editPuPool.html @@ -166,19 +166,42 @@ {$com['statement_info'][0]['time']} {$com['statement_info'][0]['game_list'][0]['pay_amount']} - - % - % + + + + + 0 + + + + + % + + 0% + + + + + % + + 0% + + {$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]['game_list'][0]['reward']||default="0"} + {$com['statement_info'][0]['game_list'][0]['fine']||default="0"} - - + + + + + 0 + {$com['statement_info'][0]['week_amount']} {$com['statement_money']} @@ -215,9 +238,12 @@ - + 不结算 + + 奖惩分离 + @@ -231,9 +257,27 @@ {$game['game_type_name']} {$game['pay_amount']} - - % - % + + + + + 0 + + + + + % + + 0% + + + + + % + + 0% + + {$game['sum_money']} @@ -264,9 +308,27 @@ {$account['game_list'][0]['pay_amount']} - - % - % + + + + + 0 + + + + + % + + 0% + + + + + % + + 0% + + {$account['game_list'][0]['sum_money']} @@ -280,8 +342,12 @@ - - + + + + + 0 + {$account['week_amount']} @@ -309,9 +375,27 @@ {$game['pay_amount']} - - % - % + + + + + 0 + + + + + % + + 0 + + + + + % + + 0 + + {$game['sum_money']} @@ -380,6 +464,34 @@ saveForm(id); }); + + var pool_ids = "{$_GET['id']}"; + $(".split_RewardOrFail").on("click",function() { + + var id = $(this).data('id'); + var st = $(this).data('st'); + layer.confirm("是否确认对该数据进行奖惩分离", {title: false}, function (index) { + $.ajax({ + type: "POST", + url: "{:U('splitRewardOrFailData')}", + dataType: 'json', + async: false, + data: {id: id, st: st, pool_id: pool_ids}, + success: function (data) { + if (data.status == 1) { + layer.msg("" + data.msg + ""); + setTimeout(function () { + window.location.reload(); + }, 1500); + } else { + layer.msg("" + data.msg + ""); + return false; + } + } + }); + }); + }); + var return_data = ""; function saveForm(id) { @@ -560,9 +672,9 @@ } else { week_amount_find = week_amount_find.prev(); } - if (i>10) { - break; - } + // if (i>10) { + // break; + // } } var D_value = parseFloat(old_amount)-parseFloat(this_amount) + parseFloat(withhold-oldwithhold); diff --git a/Application/Admin/View/CompanyStatementPool/lists.html b/Application/Admin/View/CompanyStatementPool/lists.html index 5a669cd53..2159b014e 100644 --- a/Application/Admin/View/CompanyStatementPool/lists.html +++ b/Application/Admin/View/CompanyStatementPool/lists.html @@ -217,7 +217,7 @@
- {$data.payment} + class="unPayment" style="color:blue" data-id="{$data['id']}">{$data.payment}
@@ -306,6 +306,19 @@ }); }); + $(".unPayment").click(function () { + var id = $(this).data("id"); + var url = "{:U('viewUnPaymentPool')}"+"&id="+id + layer.open({ + type: 2, + title: "海南万盟天下科技有限公司", + shadeClose: true, + shade: 0.8, + area: ['100%', '100%'], + content: url + }); + }); + $(".editPool").click(function () { var id = $(this).data("id"); var url = "{:U('editPool')}"+"&id="+id diff --git a/Application/Admin/View/CompanyStatementPool/viewCpPool.html b/Application/Admin/View/CompanyStatementPool/viewCpPool.html index 42b844d8a..0a5c28b1e 100644 --- a/Application/Admin/View/CompanyStatementPool/viewCpPool.html +++ b/Application/Admin/View/CompanyStatementPool/viewCpPool.html @@ -103,6 +103,7 @@ 产品 平台流水 未结算平台流水 + 退款 分成比例 @@ -111,6 +112,8 @@ 合作方待结算分成 违规罚款 奖励 + 其他扣款 + 周期结算金额 合作待结算金额 @@ -135,17 +138,23 @@ + + + aOh! 暂时还没有内容! + + {$com.company_name} {$com.matche_platform} - - {$com['statement_info'][0]['statement_begin_time']}-{$com['statement_info'][0]['statement_end_time']} + {$com['statement_info'][0]['time']} + {$com['statement_info'][0]['game_name']} {$com['statement_info'][0]['pay_amount']} {$com['statement_info'][0]['pay_amount']} + {$com['statement_info'][0]['refund']|default=0} {$com['statement_info'][0]['ratio']|showNumPercent} {$com['statement_info'][0]['company_ratio']|showNumPercent} {$com['statement_info'][0]['promote_ratio']|showNumPercent} @@ -154,6 +163,12 @@ {$com['fine']-0} {$com['reward']-0} + + {$com['statement_info'][0]['withhold']|default=0} + + + {$com['statement_info'][0]['week_amount']} + {$com['statement_money']} @@ -177,7 +192,7 @@ - + 不结算 @@ -187,18 +202,29 @@ - {$it['statement_begin_time']}-{$it['statement_end_time']} - - - + + + {$it['time']} + {$it['game_name']} {$it['pay_amount']} {$it['pay_amount']} + + {$it['refund']|default=0} + {$it['ratio']|showNumPercent} {$it['company_ratio']|showNumPercent} {$it['promote_ratio']|showNumPercent} {$it['fax_ratio']|showNumPercent} {$it['d_statement_money']} + + {$it['fine']-0} + {$it['reward']-0} + + {$it['withhold']|default=0} + + {$it['week_amount']} + @@ -212,10 +238,13 @@ + {$count.d_statement_money} {$count.fine} {$count.reward} + {$count.statement_money} + {$count.statement_money_s} @@ -226,6 +255,51 @@ + + + 初审状态: + + +
+ {$pool_data.firstverify} +
+ +
+ {$pool_data.firstverify} +
+
+ + + + 审批状态: + + +
+ {$pool_data.verify} +
+ +
+ {$pool_data.verify} +
+
+ + + + 打款状态: + + +
+ {$pool_data.payment} +
+ +
+ {$pool_data.payment} +
+
+ + + +
diff --git a/Application/Admin/View/CompanyStatementPool/viewPcPool.html b/Application/Admin/View/CompanyStatementPool/viewPcPool.html index 41dd1e73f..4a5642395 100644 --- a/Application/Admin/View/CompanyStatementPool/viewPcPool.html +++ b/Application/Admin/View/CompanyStatementPool/viewPcPool.html @@ -98,19 +98,21 @@ 序号 公司名称 - + 结算日期 合作产品名称 平台总额(元) + 退款 下游内团分成比例 补点比例 税费费率 分成金额/元 罚款 奖励 - + 其他扣款 + 周期结算金额 合计/元 对账人 - 结算日期 + 户名 帐号 开户行 @@ -124,23 +126,38 @@ + + + aOh! 暂时还没有内容! + + {$key-0+1} {$com.company_name} - + {$com['statement_info'][0]['time']} {$com['statement_info'][0]['game_name']} {$com['statement_info'][0]['pay_amount']} + {$com['statement_info'][0]['refund']|default=0} {$com['statement_info'][0]['ratio']|showNumPercent} {$com['statement_info'][0]['increment_ratio']|showNumPercent} {$com['statement_info'][0]['fax_ratio']|showNumPercent} {$com['statement_info'][0]['d_statement_money']} - {$com['fine']-0} - {$com['reward']-0} + + + {$com['statement_info'][0]['fine']-0} + {$com['statement_info'][0]['reward']-0} + + + {$com['statement_info'][0]['withhold']|default=0} + + + {$com['statement_info'][0]['week_amount']} + + {$com['statement_money']} {$com.settlement_contact} - {$com['statement_info'][0]['statement_begin_time']}-{$com['statement_info'][0]['statement_end_time']} @@ -157,11 +174,11 @@ - {$com.renark} + {$com.remark} - + 不结算 @@ -171,14 +188,28 @@ - + + {$it['time']} + {$it['game_name']} {$it['pay_amount']} + + {$it['refund']|default=0} + {$it['ratio']|showNumPercent} {$it['increment_ratio']|showNumPercent} {$it['fax_ratio']|showNumPercent} {$it['d_statement_money']} - {$it['statement_begin_time']}-{$it['statement_end_time']} + + + {$it['fine']-0} + {$it['reward']-0} + + {$it['withhold']|default=0} + + {$it['week_amount']} + + @@ -190,18 +221,17 @@ - 合计: + 合计: {$count.platform_amount} - + {$count.d_statement_money} {$count.fine} {$count.reward} - {$count.statement_money} - - + {$count.statement_money} + {$count.statement_money_s} @@ -213,6 +243,51 @@
+ + + 初审状态: + + +
+ {$pool_data.firstverify} +
+ +
+ {$pool_data.firstverify} +
+
+ + + + 审批状态: + + +
+ {$pool_data.verify} +
+ +
+ {$pool_data.verify} +
+
+ + + + 打款状态: + + +
+ {$pool_data.payment} +
+ +
+ {$pool_data.payment} +
+
+ + + +
diff --git a/Application/Admin/View/CompanyStatementPool/viewPuPool.html b/Application/Admin/View/CompanyStatementPool/viewPuPool.html index 04a4ab5ed..741cf1a0d 100644 --- a/Application/Admin/View/CompanyStatementPool/viewPuPool.html +++ b/Application/Admin/View/CompanyStatementPool/viewPuPool.html @@ -137,7 +137,11 @@ - + + + aOh! 暂时还没有内容! + + {$key-0+1} @@ -169,8 +173,8 @@ {$com['statement_info'][0]['game_list'][0]['increment_ratio']}% {$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]['game_list'][0]['reward']||default="0"} + {$com['statement_info'][0]['game_list'][0]['fine']||default="0"} {$com['statement_info'][0]['game_list'][0]['withhold']|default=0} {$com['statement_info'][0]['week_amount']||default="0"} {$com['statement_money']} @@ -207,7 +211,7 @@ - + 不结算 @@ -361,7 +365,51 @@ + + + 初审状态: + + +
+ {$pool_data.firstverify} +
+ +
+ {$pool_data.firstverify} +
+
+ + + + 审批状态: + + +
+ {$pool_data.verify} +
+ +
+ {$pool_data.verify} +
+
+ + + + 打款状态: + + +
+ {$pool_data.payment} +
+ +
+ {$pool_data.payment} +
+
+ + +
diff --git a/Application/Admin/View/Game/lists.html b/Application/Admin/View/Game/lists.html index dac9c34b2..f846e5604 100644 --- a/Application/Admin/View/Game/lists.html +++ b/Application/Admin/View/Game/lists.html @@ -148,6 +148,7 @@ text-indent:0; 游戏ID 游戏名称 + 归属识别号 运营平台 混服管理 游戏类型 @@ -173,6 +174,7 @@ text-indent:0; {$data.id} {$data.game_name} + {$data.unique_code|default="无"} {:get_systems_name($data['sdk_version'])} {:getServerType($data['server_type'])} diff --git a/Application/Admin/View/MarketPercentage/marketstaffsettle.html b/Application/Admin/View/MarketPercentage/marketstaffsettle.html index 0ab9ee713..9ee0bf269 100644 --- a/Application/Admin/View/MarketPercentage/marketstaffsettle.html +++ b/Application/Admin/View/MarketPercentage/marketstaffsettle.html @@ -194,6 +194,7 @@ 时间 市场专员 + 离职时间 级别
开发总流水当月自主开发下渠道游戏内充值总和
维护总流水当月只维护下渠道游戏内充值总和
@@ -222,6 +223,7 @@ {$data.pay_time|default='无'} {$data.real_name|default='无'} + {$data.leave_time|default='--'} {$data.level|default='无'} {$data.performance_revenue|default='0.00'} diff --git a/Application/Admin/View/User/edit.html b/Application/Admin/View/User/edit.html index 84f1118de..1aa028c6a 100644 --- a/Application/Admin/View/User/edit.html +++ b/Application/Admin/View/User/edit.html @@ -68,17 +68,29 @@ + + 申请离职时间: + + + + + + 离职时间: + + + + 离职状态
> 离职 + checked> 离职 - 离职状态,市场专员离职发放后自动标志未离职 + @@ -119,6 +131,11 @@ + + if(C('COLOR_STYLE')=='blue_color') echo ''; + + +
@@ -134,6 +151,29 @@