diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 4c38f8749..7cc7e1fd0 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2021,5 +2021,18 @@ function caculateUpstream($game_id,$pay_amount) { } +//获取所有有关的公司 + +function getPromoteCompanyList() { + + $sql = "select id,company_name,1 as company_type from tab_promote_company"; + + $data = M()->table("({$sql}) as a")->select(); + + + return $data; + +} + ?> diff --git a/Application/Admin/Controller/AjaxController.class.php b/Application/Admin/Controller/AjaxController.class.php index a7d6214db..77dbd2e24 100644 --- a/Application/Admin/Controller/AjaxController.class.php +++ b/Application/Admin/Controller/AjaxController.class.php @@ -243,12 +243,18 @@ class AjaxController extends ThinkController{ public function getDownstreamData() { $withdraw_number = $_REQUEST['withdraw_number']; + if ($withdraw_number) { + $map['widthdraw_number'] = $withdraw_number; + } + if ($_REQUEST['company_id']) { + $map['company_id'] = $_REQUEST['company_id']; + } $data = M("withdraw","tab_") ->field("widthdraw_number,promote_account,tab_promote_company.id as company_id,company_name,tab_withdraw.settlement_type,mobile_phone,real_name,bank_card,account_openin,address,game_ratio,bank_account") ->join("left join tab_promote on tab_withdraw.promote_id=tab_promote.id") ->join("left join tab_promote_company on tab_promote.company_id=tab_promote_company.id") - ->where(['widthdraw_number'=>$withdraw_number]) + ->where($map) ->find(); if ($data['settlement_type']==1) { diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index 7f6f4bde7..c3f8eada7 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -209,8 +209,8 @@ class MemberController extends ThinkController $field = array( "id"=>"账号ID","account"=>"玩家账号","promote_account"=>"所属推广员","balance"=>"账户平台币","recharge_total"=>"累计充值","gold_coin"=>"金币", - "alipay"=>"绑定支付宝","small_count"=>"小号","vip_level"=>"VIP等级","register_type"=>"注册方式","register_time"=>"注册时间","register_ip"=>"注册IP","login_time"=>"最后登录时间", - "device_number"=>"设备号","lock_status"=>"账号状态","check_status"=>"拉黑状态" + "small_count"=>"小号","vip_level"=>"VIP等级","register_type"=>"注册方式","register_time"=>"注册时间","register_ip"=>"注册IP","login_time"=>"最后登录时间", + "device_number"=>"设备号","lock_remark"=>"锁定备注","lock_status"=>"账号状态","check_status"=>"拉黑状态" ); data2csv($data,"玩家_玩家列表",$field); } diff --git a/Application/Admin/Controller/StatementMangementController.class.php b/Application/Admin/Controller/StatementMangementController.class.php index 2b92db498..2f21630e9 100644 --- a/Application/Admin/Controller/StatementMangementController.class.php +++ b/Application/Admin/Controller/StatementMangementController.class.php @@ -22,9 +22,20 @@ class StatementMangementController extends ThinkController $map['create_time'] = ['LT', strtotime(I('time_end')) + 86399]; } - if ($_REQUEST['statement_type']) { - $map['statement_type'] = $_REQUEST['statement_type']; + if ($_REQUEST['statement_type']||$_REQUEST['statement_type']=='0') { + if($_REQUEST['statement_type']=='2') { + $map['second_party_info'] = ['like','%"order_type":1%']; + } else { + $map['statement_type'] = $_REQUEST['statement_type']; + if ($_REQUEST['statement_type']=='1') { + + $map['second_party_info'] = ['like','%"order_type":0%']; + + } + } +// dump($map['second_party_info']);die(); } +// var_dump($map);die(); if ($_REQUEST['company_id']) { $map['company_name'] = $_REQUEST['company_id']; @@ -34,12 +45,41 @@ class StatementMangementController extends ThinkController ->where($map) ->order("create_time Desc") ->select(); +// var_dump($data);die(); + foreach ($data as $key => $value) { + $data[$key]['order'] = json_decode($value['second_party_info'],true)['order_type']; + var_dump($data[$key]['order']); + } + + $sumData = M("statement","tab_") + ->field('sum(`statement_money`) as sum_money,statement_type') + ->where($map) + ->group('statement_type') + ->select(); + + $handleSumData = []; + foreach ($sumData as $key => $value) { + + $handleSumData[$value['statement_type']] = $value['sum_money']; + } + if (!$handleSumData[1]) { + $handleSumData[1] = 0; + } + + if (!$handleSumData[0]) { + $handleSumData[0] = 0; + } + + + $this->assign('sum',$handleSumData); +// dump($sumData);die(); + foreach($data as $key => $value) { $data[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']); $data[$key]['statement_begin_time'] = date('Y-m-d H:i:s',$value['statement_begin_time']); - $data[$key]['statement_end_time'] = date('Y-m-d H:i:s',$value['statement_end_time']); + $data[$key]['statement_end_time'] = date('Y-m-d H:i:s',$value['statement_end_time']+86399); // $data[$key]['is_confirm'] = $data[$key]['is_confirm']?'确认':'未确认'; // $data[$key]['statement_type'] = $value['statement_type']?'公会对账单':'CP对账单'; @@ -67,6 +107,12 @@ class StatementMangementController extends ThinkController $statement_info = $_REQUEST['statement_info']; $sumData = $_REQUEST['sum_data']; + if ($second_party_info['settlement_type']=='补点订单') { + $second_party_info['order_type'] = 1; + } else { + $second_party_info['order_type'] = 0; + } + if (!$second_party_info||!$first_party_info||!$statement_info||!$statement_info) { $this->ajaxReturn(['code'=>0, 'msg'=>'数据错误' ]); } diff --git a/Application/Admin/View/StatementMangement/createDownstreamOrder.html b/Application/Admin/View/StatementMangement/createDownstreamOrder.html index 07b87d5a4..1e15b5239 100644 --- a/Application/Admin/View/StatementMangement/createDownstreamOrder.html +++ b/Application/Admin/View/StatementMangement/createDownstreamOrder.html @@ -5,14 +5,20 @@ 充值查询列表|----软件管理平台 - - + + + + - + + + + + +
@@ -40,7 +68,7 @@ -
+
提现单号: + @@ -175,7 +203,7 @@ var queryData = []; var statement = []; var key = 0; - + $(".select_gallery").select2(); // $("#tax").change(function () { // console.log(1) // console.log($(this).next()); @@ -282,6 +310,109 @@ }); + //搜索功能 + $("#company_name").change(function(){ + var ext_field = $("#company_name option:selected").attr('company_id'); + console.log(ext_field); + $("tbody").empty(); + + $("#company_name").val(""); + $("#settlement_type").text(""); + $("#bank_card").val(""); + $("#account_openin").val(""); + $("#address").val(""); + $("#real_name").val(""); + $("#mobile_phone").val(""); + $("#bank_account_name").val(""); + + $("tbody").append('\n' + + ' aOh! 暂时还没有内容!\n' + + ' '); + + if (ext_field) + $.ajax({ + url:"{:U('Ajax/getDownstreamData')}", + type:"get", + data:{company_id:ext_field}, + dataType:'json', + success:function(data){ + console.log($("#company_name option:selected").attr('company-type')) + + $("#company_name").val(data.data.company_name); + $("#settlement_type").text(data.data.settlement_type); + $("#bank_card").val(data.data.bank_card); + $("#account_openin").val(data.data.account_openin); + $("#address").val(data.data.address); + $("#real_name").val(data.data.real_name); + $("#mobile_phone").val(data.data.mobile_phone); + $("#settlement_type_value").val(data.data.settlement_type); + $("#bank_account_name").val(data.data.bank_account); + + $("#jfCompany").val(data.data.yfpartner); + $("#jfCompany").next().text(data.data.yfpartner); + $("#jfPerson").val(data.data.yflink_man); + $("#jfTel").val(data.data.yflink_phone); + + var game_ratio = data.data.game_ratio; + + var str = ''; + var sumAmount = 0; + var sum = 0; + + for(var p in game_ratio){ + for(var i in game_ratio[p]) { + queryData['pay_amount'] = game_ratio[p][i].sum_amount; + queryData['game_id'] = p; + queryData['game_name'] = game_ratio[p][i].game_name; + queryData['sum_money'] = (game_ratio[p][i].sum_amount*(game_ratio[p][i].selle_ratio/100)).toFixed(2); + queryData['statement_begin_time'] = game_ratio[p][i].begin_time; + queryData['statement_end_time'] = game_ratio[p][i].end_time; + queryData['second_ratio'] = game_ratio[p][i].selle_ratio; + queryData['fax_ratio'] = 0; + statement.push(queryData); + queryData=[]; + // game_name = ""; + sumAmount=sumAmount+parseFloat(game_ratio[p][i].sum_amount); + str+=""+game_ratio[p][i].begin_time+"-"+game_ratio[p][i].end_time+"" + + ""+game_ratio[p][i].game_name+"" + + ""+game_ratio[p][i].sum_amount+"" + + ""+game_ratio[p][i].selle_ratio+"%" + + "%" + + ""+(game_ratio[p][i].sum_amount*(game_ratio[p][i].selle_ratio/100)).toFixed(2)+""; + sum = sum +parseFloat((game_ratio[p][i].sum_amount*(game_ratio[p][i].selle_ratio/100)).toFixed(2)); + key++; + } + } + + str+="-罚款" + + "" + + "-" + + "-" + + "0" + + "" + + "合计" + + "---" + + ""+sumAmount+"" + + "-" + + "-" + + ""+sum+"" + + ""+ + "\n" + + "本月分成总金额(人民币大写):" + + "-" + + "-" + + ""+number_chinese(sum)+"" + + ""; + $("tbody").empty(); + $("tbody").append(str); + eventnew(); + } + }) + + }); + + function eventnew(){ $(".tax").off("blur"); $(".tax").on("blur", function() { diff --git a/Application/Admin/View/StatementMangement/lists.html b/Application/Admin/View/StatementMangement/lists.html index 3831de57c..b63d1f763 100644 --- a/Application/Admin/View/StatementMangement/lists.html +++ b/Application/Admin/View/StatementMangement/lists.html @@ -62,6 +62,7 @@ +
@@ -123,7 +124,7 @@ - 上游对账单下游对账单 + 上游对账单下游对账单下游补点对账单 {$data.create_time} {$data.company_name} {$data.statement_begin_time}-{$data.statement_end_time} @@ -138,6 +139,7 @@ + 合计公司对账金额合计:{$sum[0]}     cp对账金额合计:{$sum[1]} @@ -291,6 +293,16 @@ }); $("#search").click(function(){ + + var start = $("#time_start").val(); + var end = $("#time_end").val(); + if(start !='' && end != ''){ + if (Date.parse(start) > Date.parse(end)){ + layer.msg('开始时间必须小于等于结束时间'); + return false; + } + } + var url = $(this).attr('url'); var query = $('.jssearch').find('input').serialize(); query += "&"+$('.jssearch').find('select').serialize();