diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 0a9b2e21d..39aa08532 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2036,9 +2036,10 @@ function excelSpecialComplementEmplate($data, $all_sum_money, $all_pay_amount, $ } else {//游戏 $product_name = $value['game_name']; - $objPHPExcel->getActiveSheet()->getStyle('D'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00); - $objPHPExcel->getActiveSheet()->getStyle('E'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_000); + $objPHPExcel->getActiveSheet()->getStyle('D'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE); + $objPHPExcel->getActiveSheet()->getStyle('E'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE); $objPHPExcel->getActiveSheet()->getStyle('C'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00); + $objPHPExcel->getActiveSheet()->getStyle('F'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00); if($data['withdraw_type'] != 3) { @@ -2166,9 +2167,10 @@ function excelDownStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_al } else {//游戏 $product_name = $value['game_name']; - $objPHPExcel->getActiveSheet()->getStyle('D'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00); - $objPHPExcel->getActiveSheet()->getStyle('E'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_000); + $objPHPExcel->getActiveSheet()->getStyle('D'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE); + $objPHPExcel->getActiveSheet()->getStyle('E'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE); $objPHPExcel->getActiveSheet()->getStyle('C'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00); + $objPHPExcel->getActiveSheet()->getStyle('F'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00); if($value['increment_ratio'] == 0){ $value['increment_ratio'] = 0; diff --git a/Application/Admin/Controller/CompanyGameRatioController.class.php b/Application/Admin/Controller/CompanyGameRatioController.class.php index 77d6d837d..79c2fe3ec 100644 --- a/Application/Admin/Controller/CompanyGameRatioController.class.php +++ b/Application/Admin/Controller/CompanyGameRatioController.class.php @@ -966,11 +966,11 @@ class CompanyGameRatioController extends AdminController $turnoverratio = json_decode($turnover_ratio[$key],true); $v['turnover_ratios'][$key] = array( - array("ratio"=>$value."%","name"=>"默认比例") + array("ratio"=>floatval($value)."%","name"=>"默认比例") ); foreach($turnoverratio as $ke=>$va){ - $t=array("ratio"=>$va["ratio"]."%"); + $t=array("ratio"=>floatval($va["ratio"])."%"); if(array_key_exists("instanceof",$va)){ //存在 if($va['instanceof']=='1'){ diff --git a/Application/Admin/Controller/CompanyStatementController.class.php b/Application/Admin/Controller/CompanyStatementController.class.php index 155f69a9b..47be1cc48 100644 --- a/Application/Admin/Controller/CompanyStatementController.class.php +++ b/Application/Admin/Controller/CompanyStatementController.class.php @@ -150,7 +150,7 @@ class CompanyStatementController extends ThinkController $data = M("company_statement","tab_") ->field("id,withdraw_type,company_name,company_belong,statement_begin_time,statement_end_time,statement_money,platform_amount,verify_status,verify_log,confirm_status,confirm_log,op_time,remark") ->where($map) - ->order("FIELD(verify_status,0,1,-1,2,3,-2,-3),id desc")->page($page,$row)->select(); + ->order("statement_begin_time desc,id desc")->page($page,$row)->select(); foreach($data as $k => &$v) { @@ -372,7 +372,16 @@ class CompanyStatementController extends ThinkController public function delStatement(){ if(!isset($_REQUEST['ids'])) $this->error("参数错误"); $ids = $_REQUEST['ids']; - $dbres = $this->DBModel->where("id in ({$ids}) and verify_status = 0")->delete(); +// $dbres = $this->DBModel->where("id in ({$ids}) and verify_status = 0")->delete(); + $dbres = $this->DBModel->where("id in ({$ids})")->select(); + foreach ($dbres as $key=>$value) { + if($value['withdraw_type'] !=3) { + $this->DBModel->where("id = {$value['id']} and verify_status = 0")->delete(); + } else { + $this->DBModel->where("id = {$value['id']} and verify_status != 2")->delete(); + } + + } addOperationLog(['op_type'=>2,'key'=>$ids,"op_name"=>"删除结算单",'url'=>U('lists')]); $this->ajaxReturn(array( 'status' => 1, @@ -578,7 +587,7 @@ class CompanyStatementController extends ThinkController $cline = $line+1; if($is_export){ - $v['statement_money'] = "="; + $v['statement_money'] = "=ROUND("; } $row = 0; @@ -598,9 +607,9 @@ class CompanyStatementController extends ThinkController if($is_export){ if($v['withdraw_type'] != 3) { - $val['sum_money'] = "=K{$line}*(L{$line}+M{$line})"; + $val['sum_money'] = "=ROUND(K{$line}*(L{$line}+M{$line}),2)"; } else { - $val['sum_money'] = "=K{$line}*(M{$line})"; + $val['sum_money'] = "=ROUND(K{$line}*(M{$line}),2)"; } // $val['sum_money'] = "=J{$line}*(K{$line}+L{$line})"; $v['statement_money'] .= "N{$line}+"; @@ -625,17 +634,17 @@ class CompanyStatementController extends ThinkController if($is_export){ if($v['withdraw_type'] != 3) { - $v['statement_money'] .="N{$cline}-O{$cline}"; + $v['statement_money'] .="N{$cline}-O{$cline},2)"; } else { - $v['statement_money'] = substr($v['statement_money'],0,strlen($v['statement_money'])-1); + $v['statement_money'] = substr($v['statement_money'],0,strlen($v['statement_money'])-1).",2)"; } // dump($v['statement_money']);die(); } } if($is_export){ - $count["platform_amount"] = "=SUM(K2:K".$line.")"; - $count["sum_money"] = "=SUM(Q2:Q".$line.")"; + $count["platform_amount"] = "=ROUND(SUM(K2:K".$line."),2)"; + $count["sum_money"] = "=ROUND(SUM(Q2:Q".$line."),2)"; } $this->assign("data",$infolist); $this->assign("count",$count); @@ -1385,14 +1394,16 @@ class CompanyStatementController extends ThinkController $statement_data = []; M()->startTrans(); foreach ($data as $key => $value) { - + $begin_time = 99999999999; + $end_time = 0; + $statement_data = []; $company_data = M("promote_company","tab_")->where(['id'=>$value['company_id']])->find(); $company_type = M("company_relation","tab_")->where("first_company_id={$value['company_id']} or second_company_id={$value['company_id']}")->find(); $insert['is_payment'] = $company_type['is_payment']; - $insert['statement_begin_time'] = strtotime($value['statement_begin_time']); - $insert['statement_end_time'] = strtotime($value['statement_end_time']); +// $insert['statement_begin_time'] = strtotime($value['statement_begin_time']); +// $insert['statement_end_time'] = strtotime($value['statement_end_time']); $insert['withdraw_type'] = $withdraw_type; $insert['company_belong'] = $company_data['company_belong']; $insert['company_name'] = $company_data['company_name']; @@ -1487,12 +1498,23 @@ class CompanyStatementController extends ThinkController $amount_time['pay_way'] = ['egt',0]; foreach ($statement_info as $k => $v) { + $statement_begin_time = strtotime(str_replace('.','-',$v['statement_begin_time'])); $statement_end_time = strtotime(str_replace('.','-',$v['statement_end_time']))+86399; + if ($statement_begin_time<$begin_time) { + $begin_time = $statement_begin_time; + } + + if ($statement_end_time>$end_time) { + $end_time = $statement_end_time; + } + + $amount_time['_string'] = "payed_time between {$statement_begin_time} and {$statement_end_time} and relation_game_id={$v['relation_game_id']}"; $dataAmount = M("spend","tab_") - ->field("pay_amount,relation_game_id,relation_game_name,payed_time,game_type_name,substring_index(substring_index(promote.`chain`,'/',2),'/',-1) promote_id,chain,admin_id") + ->field("pay_amount,relation_game_id,relation_game_name,payed_time,game_type_name, + CASE WHEN substring_index(substring_index(`chain`,'/',2),'/',-1) !='' THEN substring_index(substring_index(`chain`,'/',2),'/',-1) ELSE promote_id END promote_id,chain,admin_id") ->join("left join tab_promote promote on tab_spend.promote_id=promote.id") ->join("left join tab_game game on tab_spend.game_id=game.id") ->where($amount_time) @@ -1542,9 +1564,25 @@ class CompanyStatementController extends ThinkController $insert['statement_info'] = json_encode($statement_insert); } else { + $insert['statement_info'] = json_encode($statement_info); + foreach ($statement_info as $k => $v) { + $statement_begin_time = strtotime(str_replace('.','-',$v['statement_begin_time'])); + $statement_end_time = strtotime(str_replace('.','-',$v['statement_end_time']))+86399; + + if ($statement_begin_time<$begin_time) { + $begin_time = $statement_begin_time; + } + + if ($statement_end_time>$end_time) { + $end_time = $statement_end_time; + } + } } + $insert['statement_begin_time'] = $begin_time; + $insert['statement_end_time'] = $end_time; + if ($company_type['first_company_id'] == $value['company_id']) { $insert['first_party_info'] = json_encode($proCompany_info); $insert['second_party_info'] = json_encode($secord_info); diff --git a/Application/Admin/Controller/CompanyStatementPoolController.class.php b/Application/Admin/Controller/CompanyStatementPoolController.class.php index 34a6fa726..f18a6fbac 100644 --- a/Application/Admin/Controller/CompanyStatementPoolController.class.php +++ b/Application/Admin/Controller/CompanyStatementPoolController.class.php @@ -241,7 +241,7 @@ class CompanyStatementPoolController extends ThinkController } $cline = $line+1; if($is_export){ - $v['statement_money'] = "="; + $v['statement_money'] = "=ROUND("; } $row = 0; @@ -261,44 +261,30 @@ class CompanyStatementPoolController extends ThinkController if($is_export){ if($v['withdraw_type'] != 3) { - $val['sum_money'] = "=K{$line}*(L{$line}+M{$line})"; + $val['sum_money'] = "=ROUND(K{$line}*(L{$line}+M{$line}),2)"; } else { - $val['sum_money'] = "=K{$line}*(M{$line})"; + $val['sum_money'] = "=ROUND(K{$line}*(M{$line}),2)"; } -// $val['sum_money'] = "=J{$line}*(K{$line}+L{$line})"; $v['statement_money'] .= "N{$line}+"; }else{ $count['platform_amount'] += $val['pay_amount']; $count['sum_money'] += $val['sum_money']; } } - // if($is_export){ - // //J3*(K3+L3)+M3-N3 - // if($va['statement_type'] > 0){ //罚款服务器费用 - // $va['sum_money'] = "=J{$line}"; - // }else{ - // $va['sum_money'] = "=J{$line}*(K{$line}+L{$line})+M{$line}-N{$line}"; - // } - // }else{ - // $count['platform_amount'] += $va['pay_amount']; - // $count['sum_money'] += $va['sum_money']; - // } } $v['row'] = $row; if($is_export){ - if($v['withdraw_type'] != 3) { - $v['statement_money'] .="O{$cline}-P{$cline}"; + $v['statement_money'] .="O{$cline}-P{$cline},2)"; } else { - $v['statement_money'] = substr($v['statement_money'],0,strlen($v['statement_money'])-1); + $v['statement_money'] = substr($v['statement_money'],0,strlen($v['statement_money'])-1).",2)"; } -// dump($v['statement_money']);die(); } } if($is_export){ - $count["platform_amount"] = "=SUM(K2:K".$line.")"; - $count["sum_money"] = "=SUM(Q2:Q".$line.")"; + $count["platform_amount"] = "=ROUND(SUM(K2:K".$line."),2)"; + $count["sum_money"] = "=ROUND(SUM(Q2:Q".$line."),2)"; } $this->assign("data",$infolist); $this->assign("count",$count); @@ -346,9 +332,9 @@ class CompanyStatementPoolController extends ThinkController if($is_export){ if($v['withdraw_type'] != 3) { - $va['d_statement_money'] = "=D{$line}*(1-G{$line})*(E{$line}+F{$line})"; + $va['d_statement_money'] = "=ROUND(D{$line}*(1-G{$line})*(E{$line}+F{$line}),2)"; } else { - $va['d_statement_money'] = "=D{$line}*(F{$line})"; + $va['d_statement_money'] = "=ROUND(D{$line}*(F{$line}),2)"; } }else{ if ($v['withdraw_type'] != 3) { @@ -370,7 +356,7 @@ class CompanyStatementPoolController extends ThinkController if($is_export){ if ($v['withdraw_type'] != 3) { - $v['statement_money'] = "=SUM(H{$cline}:H{$line})+J{$cline}-I{$cline}"; + $v['statement_money'] = "=ROUND(SUM(H{$cline}:H{$line})+J{$cline}-I{$cline},2)"; } @@ -383,11 +369,11 @@ class CompanyStatementPoolController extends ThinkController } if($is_export){ - $count["platform_amount"] = "=SUM(D2:D".$line.")"; - $count["d_statement_money"] = "=SUM(H2:H".$line.")"; - $count["fine"] = "=SUM(I2:I".$line.")"; - $count["reward"] = "=SUM(J2:J".$line.")"; - $count["statement_money"] = "=SUM(K2:K".$line.")"; + $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)"; } // dd($infolist); $this->assign("data",$infolist); @@ -431,7 +417,7 @@ class CompanyStatementPoolController extends ThinkController $line ++; $va['company_ratio'] = 100-$va['ratio']; if($is_export){ - $va['d_statement_money'] = "=F{$line}*G{$line}"; + $va['d_statement_money'] = "=ROUND(F{$line}*G{$line},2)"; }else{ $va['d_statement_money'] = round($va['pay_amount']*$va['ratio']/100,2); $count['platform_amount'] += $va['pay_amount']; @@ -441,7 +427,7 @@ class CompanyStatementPoolController extends ThinkController } $v['matche_platform'] = $Partner[$v['company_id']]; if($is_export){ - $v['statement_money'] = "=SUM(K{$cline}:K{$line})+M{$cline}-L{$cline}"; + $v['statement_money'] = "=ROUND(SUM(K{$cline}:K{$line})+M{$cline}-L{$cline},2)"; }else{ $count['fine'] += $v['fine']; $count['reward'] += $v['reward']; @@ -451,12 +437,12 @@ class CompanyStatementPoolController extends ThinkController } if($is_export){ - $count["d_statement_money"] = "=SUM(K3:K".$line.")"; - $count["platform_amount"] = "=SUM(E3:E".$line.")"; - $count["platform_amount2"] = "=SUM(F3:F".$line.")"; - $count["fine"] = "=SUM(L3:L".$line.")"; - $count["reward"] = "=SUM(M3:M".$line.")"; - $count["statement_money"] = "=SUM(N3:N".$line.")"; + $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)"; } // dd($infolist); $this->assign("data",$infolist); @@ -799,7 +785,12 @@ class CompanyStatementPoolController extends ThinkController if($re_op){ //公司及上游回退 if($db_res['company_type'] == 2){ - $this->retry($db_res); //个人重算 + + if($db_res['withdraw_type'] == 3) { + $this->cancelCompanyPool($db_res);//公司撤回 + } else { + $this->retry($db_res); //个人重算 + } }else{ $this->cancelCompanyPool($db_res);//公司撤回 } @@ -1063,7 +1054,7 @@ class CompanyStatementPoolController extends ThinkController $mentBtn = [ "verifyAgree"=>"<a class='butn' id='verifyAgree'>审批通过</a>", "verifyRefuse"=>"<a class='butn' id='verifyRefuse' style='background-color: red;'>审核拒绝</a>", - "export"=>"<a class='butn' id='export'>批量导出</a>" + "export"=>"<a class='butn' id='export'>导出</a>" ]; $resarr = []; foreach ($mentBtn as $k => $v) { diff --git a/Application/Admin/Controller/GameRatioMouldController.class.php b/Application/Admin/Controller/GameRatioMouldController.class.php index eac5363f7..17ff6fea9 100644 --- a/Application/Admin/Controller/GameRatioMouldController.class.php +++ b/Application/Admin/Controller/GameRatioMouldController.class.php @@ -214,11 +214,11 @@ class GameRatioMouldController extends AdminController protected function readTurnoverRatio(&$v){ $turnover_ratio = json_decode($v['turnover_ratio'],true); $v['turnover_ratio'] = array( - array("ratio"=>$v['ratio']."%","name"=>"默认比例") + array("ratio"=>floatval($v['ratio'])."%","name"=>"默认比例") ); foreach($turnover_ratio as $ke=>$va){ - $t=array("ratio"=>$va["ratio"]."%"); + $t=array("ratio"=>floatval($va["ratio"])."%"); if(array_key_exists("instanceof",$va)){ //存在 if($va['instanceof']=='1'){ diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 88e36503b..0e0e997d3 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -259,7 +259,7 @@ class PromoteCompanyController extends ThinkController $map["create_time"] = ['ELT',$time_end]; } $model = M("promote_company_verify", 'tab_'); - $data = $model->where($map)->page($page,$row)->order("FIELD(verify_status,0,1,-1,-2,2),id desc")->select(); + $data = $model->where($map)->page($page,$row)->order("create_time desc")->select(); foreach ($data as $k => &$v) { $v['company_info'] = json_decode($v['company_info'],true); if($v['company_id'] == 0){ @@ -362,6 +362,7 @@ class PromoteCompanyController extends ThinkController $v['verify_log']['market_time']=date("Y-m-d H:i:s"); $v['verify_log'] = json_encode($v['verify_log']); $v['verify_status']=-1; + $v["create_time"] = time(); M("PromoteCompanyVerify", 'tab_')->save($v); addOperationLog(['op_type'=>1,'key'=>$v['id'],"op_name"=>"市场部审核",'url'=>U('index')]); } @@ -381,6 +382,7 @@ class PromoteCompanyController extends ThinkController $v['verify_log']['admin_time']=date("Y-m-d H:i:s"); $v['verify_log'] = json_encode($v['verify_log']); $v['verify_status']=-2; + $v["create_time"] = time(); M("PromoteCompanyVerify", 'tab_')->save($v); addOperationLog(['op_type'=>1,'key'=>$v['id'],"op_name"=>"管理员审核",'url'=>U('index')]); } diff --git a/Application/Admin/View/CompanyStatement/lists.html b/Application/Admin/View/CompanyStatement/lists.html index bc77a6907..609360396 100644 --- a/Application/Admin/View/CompanyStatement/lists.html +++ b/Application/Admin/View/CompanyStatement/lists.html @@ -486,7 +486,7 @@ }else if(id=="delStatement"){ var opname = "批量删除"; var opurl = "{:U('delStatement')}"; - var opst ="[未进行审批]"; + var opst ="[未进行审批,特殊补点(除汇总状态)]"; var status = [0]; var confirm = true; } @@ -494,6 +494,10 @@ var flag = false; var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { + if (id=="delStatement"&&$(elem).data("type")==3&&$(elem).data("status") == 2) { + flag = true; + } + if($.inArray( $(elem).data("status"),status) == -1||(id=="updateStatement" && $(elem).data("type")==3)){ flag = true; }else{ diff --git a/Application/Admin/View/CompanyStatement/viewSpecialComplement.html b/Application/Admin/View/CompanyStatement/viewSpecialComplement.html index 3a0cc3dc3..b23770a61 100644 --- a/Application/Admin/View/CompanyStatement/viewSpecialComplement.html +++ b/Application/Admin/View/CompanyStatement/viewSpecialComplement.html @@ -236,13 +236,15 @@ format: 'yyyy-mm-dd', language:"zh-CN", minView:2, - autoclose:true + autoclose:true, + endDate : new Date() }); $('#time_end').datetimepicker({ format: 'yyyy-mm-dd', language:"zh-CN", minView:2, - autoclose:true + autoclose:true, + endDate : new Date() }); $('#datetimepicker').datetimepicker({ @@ -533,10 +535,10 @@ } $('#tablebox').find('tbody').prepend(html); - complementChange(); DeleteTd(); caculateAmount(); + } } else { @@ -572,6 +574,8 @@ $('.complement').change(function() { //获取总流水 var pay_amount = parseFloat($(this).parent().prev().prev().text()); + var show_ratio = $(this).parent().prev().text(); + show_ratio = parseFloat(show_ratio.slice(0,show_ratio.length-1)); //计算最终分配比率 var ratio = parseFloat($(this).val()); @@ -580,10 +584,14 @@ $(this).val(0); ratio = 0; } - - if (ratio>100) { - $(this).val(100); - ratio = 100; + if(!ratio) { + $(this).val(0); + ratio=0; + } + // console.log(ratio+show_ratio); + if ((ratio+show_ratio)>100) { + $(this).val(100-show_ratio); + ratio = 100-show_ratio; } //最终的分配金额 var withdraw_amount = ((pay_amount * ratio)/100).toFixed(2); @@ -592,6 +600,7 @@ caculateAmount(); }); } + //删除操作 function DeleteTd() { diff --git a/Application/Admin/View/Promote/add.html b/Application/Admin/View/Promote/add.html index d0d3561f8..e9dcab610 100644 --- a/Application/Admin/View/Promote/add.html +++ b/Application/Admin/View/Promote/add.html @@ -2,10 +2,33 @@ <block name="body"> <link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all"> +<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" /> <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script> <script type="text/javascript" src="__STATIC__/provincecityarea/AreaData_min.js"></script><!-- <script type="text/javascript" src="__STATIC__/provincecityarea/jquery-1.7.min.js"></script> --> - +<style> + .select2-container--default .select2-selection--single { + color: #000; + resize: none; + border-width: 1px; + border-style: solid; + border-color: #a7b5bc #ced9df #ced9df #a7b5bc; + box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px; + height:28px;border-radius:3px;font-size:12px; + } + .select2-container--default .select2-selection--single .select2-selection__rendered { + line-height:35px; + line-height:28px; + } + .select2-container--default .select2-selection--single .select2-selection__arrow { + height:26px; + } + .select2-container--default .select2-search--dropdown .select2-search__field { + height:26px;line-height:26px;font-size:12px; + } + .select2-results__option[aria-selected] {font-size:12px;} + .layui-layer-dialog .layui-layer-content{color:red} +</style> <div class="cf main-place top_nav_list navtab_list"> <h3 class="page_title">新增会长</h3> @@ -42,7 +65,7 @@ <tr> <td class="l"><i class="mustmark" style="margin-left:-7px">*</i>所属推广公司</td> <td class="r"> - <select name="company_id" id="company_id"> + <select name="company_id" id="company_id" class="select_gallery"> <option value="-1">请选择推广公司</option> <option value="0">{:C(DEFAULT_COMPANY)}</option> <volist name="companys" id="vo"> @@ -200,6 +223,7 @@ <block name="script"> <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script><script type="text/javascript" src="__STATIC__/provincecityarea/area1.js"></script> +<script type="text/javascript" src="__JS__/select2.min.js"></script> <script type="text/javascript"> //导航高亮 highlight_subnav('{:U('Promote/lists')}'); @@ -208,6 +232,7 @@ Think.setValue("category", {$data.category|default = 0}); $(function(){ showTab(); + $(".select_gallery").select2(); prov="{:substr($data['bank_area'],0,2)}"; city="{:substr($data['bank_area'],2,2)}"; ciarea="{:substr($data['bank_area'],4,2)}"; diff --git a/Application/Admin/View/Promote/edit.html b/Application/Admin/View/Promote/edit.html index 96a199a74..1e32f3003 100644 --- a/Application/Admin/View/Promote/edit.html +++ b/Application/Admin/View/Promote/edit.html @@ -2,6 +2,7 @@ <block name="body"> <!-- <link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all"> --> +<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" /> <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script> <script type="text/javascript" src="__STATIC__/provincecityarea/area1.js"></script> <script type="text/javascript" src="__STATIC__/provincecityarea/AreaData_min.js"></script> @@ -180,7 +181,7 @@ <tr> <td class="l">推广公司:</td> <td class="r"> - <select name="company_id" id="company_id" + <select name="company_id" id="company_id" class="select_gallery" <if condition="$data['level'] != 1"> disabled style="background:#CCCCCC" </if>> <option value="-1">请选择推广公司</option> @@ -457,8 +458,9 @@ <block name="script"> <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script> - <script src="__STATIC__/layer/layer.js" type="text/javascript"></script> - <script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js" ></script> +<script src="__STATIC__/layer/layer.js" type="text/javascript"></script> +<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js" ></script> +<script type="text/javascript" src="__JS__/select2.min.js"></script> <script type="text/javascript"> //导航高亮 highlight_subnav("{:U('Promote/lists')}"); @@ -474,7 +476,7 @@ $(function(){ city="{:substr($data['bank_area'],2,2)}"; ciarea="{:substr($data['bank_area'],4,2)}"; //initComplexArea('seachprov', 'seachcity', 'seachdistrict', area_array, sub_array, prov, city, ciarea); - + $(".select_gallery").select2(); $("input[name=company_belong]").click(function () { if ($(this).val() == 1) { $('#company_relation').show(); diff --git a/Application/Admin/View/PromoteCompany/edit.html b/Application/Admin/View/PromoteCompany/edit.html index 842c120a9..c064a26d4 100644 --- a/Application/Admin/View/PromoteCompany/edit.html +++ b/Application/Admin/View/PromoteCompany/edit.html @@ -421,10 +421,10 @@ <td class="r table_radio"> <span class="form_radio table_btn"> <label> - <input type="radio" value="1" name="relation[is_payment]" checked="checked"> 是 + <input type="radio" value="1" name="relation[is_payment]" <?php if($relation['is_payment'] == 1):?>checked<?php endif;?>> 是 </label> <label> - <input type="radio" value="2" name="relation[is_payment]"> 否 + <input type="radio" value="2" name="relation[is_payment]" <?php if($relation['is_payment'] == 2):?>checked<?php endif;?>> 否 </label> </span> <span class="notice-text">选择否将不能进行线上打款</span> diff --git a/Application/Base/Service/PromoteCompanyService.class.php b/Application/Base/Service/PromoteCompanyService.class.php index 66c1c09df..a34dfe286 100644 --- a/Application/Base/Service/PromoteCompanyService.class.php +++ b/Application/Base/Service/PromoteCompanyService.class.php @@ -157,6 +157,7 @@ class PromoteCompanyService $verifyLog['admin_time'] = date("Y-m-d H:i:s"); $application['verify_log'] = json_encode($verifyLog); $application['verify_status'] = 2; + $application["create_time"] = time(); $companyInfo = json_decode($application['company_info'], true); $creator = M('ucenter_member', 'sys_')->field(['id', 'username'])->where(['username' => $verifyLog['create_user']])->find(); @@ -311,6 +312,7 @@ class PromoteCompanyService $application['verify_log']['market_time'] = date("Y-m-d H:i:s"); $application['verify_log'] = json_encode($application['verify_log']); $application['verify_status'] = 1; + $application["create_time"] = time(); M('promote_company_verify', 'tab_')->where(['id' => $application['id']])->save($application); addOperationLog(['op_type'=>1, 'key'=> $application['id'], "op_name"=>"市场部审核", 'url'=>U('index')]); return $application; diff --git a/Application/Home/Controller/ApplyController.class.php b/Application/Home/Controller/ApplyController.class.php index 1fd33a97a..a45c9fbc6 100644 --- a/Application/Home/Controller/ApplyController.class.php +++ b/Application/Home/Controller/ApplyController.class.php @@ -217,104 +217,42 @@ class ApplyController extends BaseController //查看游戏资料专区 public function feature($p = 0, $type = 0) { - $promoteId = empty(I('promote_id')) ? PID : I('promote_id');//搜索的渠道ID - $promoteRole = empty(I('promote_role')) ? 1 : I('promote_role');//渠道角色 - //$parentPromoteId = getParentPromoteId($promoteId);//上级渠道ID - $thisParentPromoteId = getParentPromoteId(PID);//本账号上级渠道ID + $map = ['_string' => '1=1']; + $map['online_status'] = 1;//开发者游戏上线状态 + $map['down_port'] = 1;//游戏端口 第三方接口不能申请 + $map['game_status'] = 1;//游戏状态 + $map['developers'] = 0; //平台游戏(官网游戏,非开发者游戏) -// $addPermission = 1;//是否有添加游戏权限 -// if ($thisParentPromoteId == 0 && $promoteRole == 3) { -// $addPermission = 0; -// } - - $map['tab_game.online_status'] = 1;//开发者游戏上线状态 - $map['tab_game.down_port'] = 1;//游戏端口 第三方接口不能申请 - $map['tab_game.game_status'] = 1;//游戏状态 - $map['tab_game.developers'] = 0; //平台游戏(官网游戏,非开发者游戏) - - $applyPromote = M('apply', 'tab_')->field('game_id')->where(['promote_id' => $promoteId])->select(); - $noDeveloperGameArr = array(); - - foreach ($applyPromote as $key => $value) { - $applyPromoteGameId = $value['game_id']; - $gameInfo = M('Game', 'tab_') - ->field('id,icon,game_name,features,sdk_version,game_size,game_type_name,relation_game_name,developers') - ->where(['id' => $applyPromoteGameId])->select(); - if ($gameInfo[0]['developers'] > 0) { - unset($gameInfo[0]['developers']); - $noDeveloperGameArr[] = $gameInfo[0]['id']; //非开发者游戏 - } - } - - - $page = intval($p); - $page = $page ? $page : 1; //默认显示第一页数据 - - if (isset($_REQUEST['row'])) { - $row = $_REQUEST['row']; + $promote = $this->getLoginPromote(); + $promoteService = new PromoteService(); + $gameIds = $promoteService->getVisibleGameIds($promote); + if (count($gameIds) > 0) { + $map['id'] = ['in', $gameIds]; } else { - $row = 10; + $map['_string'] .= ' and 1<>1'; } - $map['_logic'] = 'and'; + if (!empty(I('game_id'))) { - $thisRelationGameName = M('Game', 'tab_')->where(array('id' => I('game_id')))->getField('relation_game_name'); - - $map['tab_game.relation_game_name'] = ['like', $thisRelationGameName]; - $where['_complex'] = $map; - // $where['tab_game.id'] = ['in',$noDeveloperGameArr]; - // $where['_logic']='or'; - } else { - $where['_complex'] = $map; - if (empty($noDeveloperGameArr)) { - $where['tab_game.id'] = ['in', '-100']; + $relationGameId = M('game', 'tab_')->where(array('id' => I('game_id')))->getField('relation_game_id'); + if ($relationGameId) { + $map['_string'] .= ' and relation_game_id=' . $relationGameId; } else { - $where['tab_game.id'] = ['in', $noDeveloperGameArr]; + $map['_string'] .= ' and 1<>1'; } - - $where['_logic'] = 'or'; } - $data = M('Game', 'tab_') - ->field('tab_game.id,tab_game.icon,tab_game.game_name,tab_game.features,tab_game.sdk_version,tab_game.game_size,tab_game.game_type_name,tab_game.relation_game_name,ta_1.id as apply_id_1') - ->join('left join tab_apply as ta_1 on tab_game.id = ta_1.game_id and ta_1.offline_status = 0 and ta_1.promote_id = ' . $promoteId)//查询是否拥有该游戏 - ->where($where) - ->order('tab_game.developers desc,tab_game.sort desc,tab_game.id desc') - ->page($page, $row) - ->select(); - //$AllData = array_merge($noDeveloperGameArr,$data); - - /* 查询记录总数 */ - $count = M("Game", "tab_") - ->field('tab_game.id') + $query = M('game', 'tab_') + ->field('id,icon,game_name,features,sdk_version,game_size,game_type_name,relation_game_name') ->where($map) - ->select(); - $count = count($count); - - //分页 - $parameter['p'] = I('get.p', 1); - $parameter['row'] = I('get.row'); - $parameter['type'] = $type; - $parameter['promote_role'] = $promoteRole; - empty(I('promote_id')) || $parameter['promote_id'] = I('promote_id'); - - $page = set_pagination($count, $row, $parameter); - if ($page) { - $this->assign('_page', $page); - } - - $this->assign('list_data', $data); - $this->assign("count", $count); - $this->assign("promoteId", $promoteId); - // $this->assign('parentPromoteId', $parentPromoteId); - $this->assign('thisParentPromoteId', $thisParentPromoteId); - // $this->assign('promoteRole', $promoteRole); - $this->assign('pID', PID); - //$this->assign('promoteData', getAllPromoteListByType($promoteRole)); -// $this->assign('addPermission', $addPermission); - // $this->assign('type', $type); + ->order('developers desc,sort desc,id desc'); - $this->meta_title = "申请游戏"; + list($records, $pagination, $count) = $this->paginate($query); + $this->assign('pagination', $pagination); + $this->assign('records', $records); + $this->assign('count', $count); + $this->assign('games', $this->getSelectGames()); + $this->meta_title = "资料专区"; $this->display(); } diff --git a/Application/Home/Controller/BaseController.class.php b/Application/Home/Controller/BaseController.class.php index fa876e441..fae35173b 100644 --- a/Application/Home/Controller/BaseController.class.php +++ b/Application/Home/Controller/BaseController.class.php @@ -410,4 +410,28 @@ class BaseController extends HomeController } return false; } + + public function getSelectGames() + { + $query = M('game', 'tab_'); + $map = []; + $map['apply_status'] = 1; + $map['online_status'] = 1; + $map['down_port'] = 1; + + $promote = $this->getLoginPromote(); + $promoteService = new PromoteService(); + $gameIds = $promoteService->getVisibleGameIds($promote); + if (count($gameIds) > 0) { + $map['id'] = ['in', $gameIds]; + } else { + $map['_string'] = '1<>1'; + } + + return M('game', 'tab_') + ->field('id,game_name,sdk_version,relation_game_name,icon,relation_game_id') + ->where($map) + ->group('relation_game_id') + ->select(); + } } diff --git a/Application/Home/View/default/Apply/feature.html b/Application/Home/View/default/Apply/feature.html index 86e5dd89c..024d4d6fb 100644 --- a/Application/Home/View/default/Apply/feature.html +++ b/Application/Home/View/default/Apply/feature.html @@ -146,9 +146,9 @@ <div class="form-group normal_space fr"> <select id="game_id" name="game_id" class="reselect select_gallery" style="min-width:200px;width: 175px;"> <option value="">请选择游戏名称</option> - <volist name=":get_promote_serach_game()" id="vo"> - <option value="{$vo.id}" title="{$vo.relation_game_name}">{$vo.relation_game_name}</option> - </volist> + <?php foreach($games as $game):?> + <option value="<?=$game['id']?>" title="<?=$game['relation_game_name']?>"><?=$game['relation_game_name']?></option> + <?php endforeach;?> </select> </div> @@ -163,7 +163,7 @@ <div class="trunk-list"> <div class="div_bgtab"> <ul class="game-ul"> - <empty name="list_data"> + <empty name="records"> <ul class="game-ul"> <li class="game-li" style="text-align: center;"> <img src="__IMG__/20180207/icon_wushujv2.png"/> @@ -171,7 +171,7 @@ </li> </ul> <else/> - <volist name="list_data" id="vo"> + <volist name="records" id="vo"> <li class="game-li"> <div class="media"> <div class="img-box" onclick="viewGameDetailed({$vo.id})"> @@ -186,37 +186,10 @@ </if> </h5> <p><span style="color:#76838F">{$vo.features}</span></p> - <!-- <p> - <if condition="$type eq 10"> - <span>平台:<span>Android+ios</span> </span> - <else/> - <span>平台:<span>{:getSDKTypeName($vo['sdk_version'])}</span> </span> - </if> - <span>版本:<span>{$vo.version}</span> </span> - <span>大小:<span>{$vo.game_size}</span> </span> - <span>游戏类型:<span>{$vo.game_type_name}</span> </span> - </p>--> </div> <div class="game-operating" style="width: 8%;"> - <!--<if condition="$type eq 10"> - <if condition="addedAboutDoubleSdk($promoteId,$vo['id']) eq 1"> - <span class="add-disable" style="cursor: pointer;">已添加</span> - <else/> - <span onclick="commonApply({$vo.id},this,0,10)" style="cursor: pointer;"><u>添加</u></span> - </if> - <else/> - <if condition="$vo.apply_id_1 gt 0"> - <span class="add-disable" style="cursor: pointer;">已添加</span> - <else/> - <span onclick="commonApply({$vo.id},this,0,0)" style="cursor: pointer;"><u>添加</u></span> - </if> - </if>--> - <!--<span onclick="commonApply({$vo.id},this,0,0)" style="cursor: pointer;"><u>查看详情</u></span>--> -<!-- <span onclick="lookdetail({$vo.id})" style="cursor: pointer;"><u class="lookdetail">查看详情</u></span>--> <div class="site-demo-button" id="layerDemo" style="margin-bottom: 0;"> -<!-- <button data-method="notice" class="layui-btn">示范一个公告层</button>--> <span id="detailArr" onclick="lookdetail({$vo.id})" class="layui-btn" style="cursor: pointer;background:#62A8EA"><u>查看详情</u></span> - </div> </div> </div> @@ -226,7 +199,7 @@ </ul> </div> <div class="pagenation clearfix"> - {$_page} + {$pagination} </div> </div> </div> diff --git a/Public/Admin/excel/down_stream.xls b/Public/Admin/excel/down_stream.xls index a8539a39d..80c582863 100644 Binary files a/Public/Admin/excel/down_stream.xls and b/Public/Admin/excel/down_stream.xls differ