Merge branch 'feature/group_type' into dev

master
zhengyongxing 5 years ago
commit 943969bddd

@ -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;
}
?>

@ -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) {

@ -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);
}

@ -22,9 +22,20 @@ class StatementMangementController extends ThinkController
$map['create_time'] = ['LT', strtotime(I('time_end')) + 86399];
}
if ($_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'=>'数据错误' ]);
}

@ -5,14 +5,20 @@
<meta charset="UTF-8">
<title>充值查询列表|----软件管理平台</title>
<link href="http://admin.vlcms.com/Public/icon.ico" type="image/x-icon" rel="shortcut icon">
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/module.css">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="__JS__/jquery.mousewheel.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"charset="UTF-8"></script>
<script src="__STATIC__/juicer-min.js" type="text/javascript"></script>
</head>
<style>
body {
@ -27,6 +33,28 @@
line-height: 40px;
}
</style>
<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;}
</style>
<body>
<div id="main" class="main" style="min-height: 342px;width: 92.5%;">
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
@ -40,7 +68,7 @@
<!-- <div class="input-list search-title-box">-->
<!-- <label>乙方:</label>-->
<!-- </div>-->
<div class="input-list input-list-promote search_label_rehab" style="width: 50%;">
<div class="input-list input-list-game search_label_rehab" style="width: 50%;">
提现单号:
<select id="ext_field" name="ext_field" class="select_gallery" style="width: 50%">
<option value="">提现单号</option>
@ -56,9 +84,9 @@
<div class="input-list input-list-promote search_label_rehab" style="width: 50%">
乙 方:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<select disabled="disabled" id="company_name" name="company_name" class="select_gallery" style="width: 50%">
<select id="company_name" name="company_name" class="select_gallery" style="width: 50%">
<option value="">乙 方</option>
<volist name=":getCompanyList()" id="vo">
<volist name=":getPromoteCompanyList()" id="vo">
<option company_id="{$vo.id}" value="{$vo.company_name}">{$vo.company_name}</option>
</volist>
</select>
@ -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('<tr>\n' +
' <td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>\n' +
' </tr>');
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 = "<?php echo get_gamename('"+game_id+"')?>";
sumAmount=sumAmount+parseFloat(game_ratio[p][i].sum_amount);
str+="<tr class='statement_data_"+key+"'><td class='time_"+key+"' begin_time='"+game_ratio[p][i].begin_time+"' end_time='"+game_ratio[p][i].end_time+
"'>"+game_ratio[p][i].begin_time+"-"+game_ratio[p][i].end_time+"</td>" +
"<td class='game_name_"+key+"' game_id='"+p+"'>"+game_ratio[p][i].game_name+"</td>" +
"<td class='pay_amount_"+key+"'>"+game_ratio[p][i].sum_amount+"</td>" +
"<td class='second_ratio_"+key+"' second_ratio='"+game_ratio[p][i].selle_ratio+"'>"+game_ratio[p][i].selle_ratio+"%</td>" +
"<td><input value='0' style='width: 30px' class='tax tax_"+key+"'/>%</td>" +
"<td id='sum_"+key+"' data-value='"+(game_ratio[p][i].sum_amount*(game_ratio[p][i].selle_ratio/100)).toFixed(2)+"'>"+(game_ratio[p][i].sum_amount*(game_ratio[p][i].selle_ratio/100)).toFixed(2)+"</td></tr>";
sum = sum +parseFloat((game_ratio[p][i].sum_amount*(game_ratio[p][i].selle_ratio/100)).toFixed(2));
key++;
}
}
str+="<tr class=''><td>-</td><td>罚款</td>" +
"<td><input value='0' style='width: 30px' class='forfeit'/></td>" +
"<td>-</td>" +
"<td>-</td>" +
"<td>0</td>" +
"</tr>" +
"<tr><td>合计</td>" +
"<td>---</td>" +
"<td class='sumAmount' data-value='"+sumAmount+"'>"+sumAmount+"</td>" +
"<td>-</td>" +
"<td>-</td>" +
"<td class='sumAll' data-value='"+sum+"'>"+sum+"</td>" +
"</tr>"+
"<tr><td colspan='3'>\n" +
"本月分成总金额(人民币大写)</td>" +
"<td>-</td>" +
"<td>-</td>" +
"<td data-value='"+sum+"'>"+number_chinese(sum)+"</td>" +
"</tr>";
$("tbody").empty();
$("tbody").append(str);
eventnew();
}
})
});
function eventnew(){
$(".tax").off("blur");
$(".tax").on("blur", function() {

@ -62,6 +62,7 @@
<option value="">对账类型</option>
<option value="0">上游对账单</option>
<option value="1">下游对账单</option>
<option value="2">下游补点对账单</option>
</select>
</div>
<div class="input-list input-list-promote search_label_rehab">
@ -123,7 +124,7 @@
<notemtpy name = "data">
<volist name="data" id="data">
<tr>
<td><if condition="$data['statement_type'] eq 0">上游对账单<elseif condition="$data['statement_type'] eq 1"/>下游对账单</if></td>
<td><if condition="$data['statement_type'] eq 0">上游对账单<elseif condition="$data['statement_type'] eq 1 and $data['order'] eq 0"/>下游对账单<elseif condition="$data['statement_type'] eq 1 and $data['order'] eq 1"/>下游补点对账单</if></td>
<td>{$data.create_time}</td>
<td>{$data.company_name}</td>
<td>{$data.statement_begin_time}-{$data.statement_end_time}</td>
@ -138,6 +139,7 @@
</td>
</tr>
</volist>
<tr><td>合计</td><td colspan="10">公司对账金额合计:{$sum[0]}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp对账金额合计{$sum[1]}</td></tr>
</notemtpy>
</tbody>
</table>
@ -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();

Loading…
Cancel
Save