Merge branch 'feature/platfrom_aggregate_finance' of wmtx/platform into release

新增分成生效模板
master
廖金灵 5 years ago committed by Gogs
commit 0f186befc2

@ -20,8 +20,101 @@ class CompanyGameRatioController extends AdminController
$this->DBModel = M("company_game_ratio","tab_");
parent::_initialize();
}
public function index()
{
$params = I('get.');
$page = $params['p'] ? intval($params['p']) : 1;
$row = $params['row'] ? intval($params['row']) : 10;
//权限分配
if(!IS_ROOT){
$this->OpAuthList= getModuleControllerAuth();
}
$gamewhere['_string'] = '1 = 1';
$where['_string'] = '1 = 1';
if(isset($params['relation_game_id'])){
$gamewhere['relation_game_id'] = $params['relation_game_id'];
$where['m.relation_game_id'] = $params['relation_game_id'];
}
if(isset($params['company_id'])){
$where['m.company_id'] = $params['company_id'];
}
$this->checkListOrCountAuthRestMap($where);
$gameres = M("game","tab_")->field("tab_game.relation_game_id,tab_game.relation_game_name,IF(tab_game.original_package_name='','未配置',tab_game.original_package_name) original_package_name,tab_game_type.type_name game_type_name")->where($gamewhere)->join("tab_game_type on tab_game.game_type_id = tab_game_type.id")->group("tab_game.relation_game_id")->select(false);
$dbres = M("company_game_ratio","tab_")
->alias('m')
->field("m.*,g.*,p.company_name,p.company_belong,IFNULL(r.settlement_type,0) settlement_type")
->join("left JOIN ({$gameres}) g ON m.relation_game_id = g.relation_game_id")
->join("left JOIN tab_promote_company p ON m.company_id = p.id")
->join("left JOIN tab_company_relation r ON (r.first_company_type =2 AND r.first_company_id = m.company_id) OR (r.second_company_type =2 AND r.second_company_id = m.company_id)")
->where($where);
if(isset($params['export'])){
$dbres = $dbres->select();
}else{
$dbres = $dbres->page($page, $row)->select();
}
foreach($dbres as $k=>&$v){
$v['begin_time'] = date("Y-m-d",$v['begin_time']);
$v['end_time'] = $v['end_time'] ? date('Y-m-d', $v['end_time']) : '永久';
$v["valid"] = "{$v['begin_time']} ~ {$v['end_time']}";
$v['company_belong'] ="下游".getCompanyBlong($v['company_belong']);
if (isset($params['export'])) {
$symbol = "\n";
} else {
$symbol = "<br>";
}
if($v['settlement_type'] == 0){
$v['settlement_type'] = '--';
}else{
$v['settlement_type'] = $v['settlement_type']== 1 ? "周结" : '月结';
}
//新
$thisTurnoverRatios = $v['turnover_ratio'] ? json_decode($v['turnover_ratio'], true) : [];
$thisRatioDtl = "默认:{$v['ratio']}%";
if ($thisTurnoverRatios) {
foreach ($thisTurnoverRatios as $thisTurnoverRatio) {
$thisIntervalClosedStatusText = isset($thisTurnoverRatio['instanceof']) ? ($thisTurnoverRatio['instanceof'] == 1 ? '≥' : '>') : '≥';
$thisRatioDtl .= "{$symbol}月流水{$thisIntervalClosedStatusText}{$thisTurnoverRatio['turnover']},比例:{$thisTurnoverRatio['ratio']}%";
}
}
$v['turnover_ratio_str'] = $thisRatioDtl;
$v['oplist'] = $this->OpAuth($v);
}
if(isset($_REQUEST['export'])){
$GetData = $_GET;
unset($GetData['export']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),"op_name"=>"导出",'url'=>U(CONTROLLER_NAME.'/'.ACTION_NAME,$GetData)]);
data2csv($dbres,'推广游戏分成管理',array(
"company_name"=>"公司名称",
"company_belong"=>"内外团",
"settlement_type"=>"结算周期",
"game_type_name"=>"游戏类型",
"original_package_name"=>"原游戏名称",
"relation_game_name"=>"现游戏名称",
"valid"=>"生效时间",
"turnover_ratio_str"=>"分成比例"
));
}
$count = M("company_game_ratio","tab_")->alias('m')->field("count(id) count")->where($where)->find()['count'];
$this->assign('data', $dbres);
$page = set_pagination($count, $row);
if($page) {
$this->assign('_page', $page);
}
$this->assign("companyList",D("PromoteCompany")->getList());
$this->assign("gameList",D("Game")->getRelationGameLits());
$this->display();
dd( $dbres);
}
public function lists()
{
$params = I('get.');
$page = $params['p'] ? intval($params['p']) : 1;
@ -43,14 +136,15 @@ class CompanyGameRatioController extends AdminController
if(isset($params['status'])){
$where['m.status'] = $params['status'];
}
//TODO:未计算公司类型,未进行排序
//TODO:未计算公司类型
$this->checkListOrCountAuthRestMap($where);
$gameres = M("game","tab_")->field("tab_game.relation_game_id,tab_game.relation_game_name,IF(tab_game.original_package_name='','未配置',tab_game.original_package_name) original_package_name,tab_game_type.type_name game_type_name")->where($gamewhere)->join("tab_game_type on tab_game.game_type_id = tab_game_type.id")->group("tab_game.relation_game_id")->select(false);
$dbres = M("company_game_ratio_log","tab_")
->alias('m')
->field("m.*,g.*,p.company_name,p.company_belong")
->field("m.*,g.*,p.company_name,p.company_belong,IFNULL(r.settlement_type,0) settlement_type")
->join("left JOIN ({$gameres}) g ON m.relation_game_id = g.relation_game_id")
->join("left JOIN tab_promote_company p ON m.company_id = p.id")
->join("left JOIN tab_company_relation r ON (r.first_company_type =2 AND r.first_company_id = m.company_id) OR (r.second_company_type =2 AND r.second_company_id = m.company_id)")
->where($where)
->order("FIELD(m.status,0,1,-1,-2,2),id desc");
if(isset($params['export'])){
@ -59,7 +153,11 @@ class CompanyGameRatioController extends AdminController
$dbres = $dbres->page($page, $row)->select();
}
foreach($dbres as $k=>&$v){
$v['settlement_type'] ='--';
if($v['settlement_type'] == 0){
$v['settlement_type'] = '--';
}else{
$v['settlement_type'] = $v['settlement_type']== 1 ? "周结" : '月结';
}
$v['begin_time'] = date("Y-m-d",$v['begin_time']);
$v['end_time'] = $v['end_time'] ? date('Y-m-d', $v['end_time']) : '永久';
@ -156,6 +254,8 @@ class CompanyGameRatioController extends AdminController
$this->assign("gameList",D("Game")->getRelationGameLits());
$this->display();
}
public function marketAgree(){
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
@ -369,6 +469,20 @@ class CompanyGameRatioController extends AdminController
}
$id = $_REQUEST['id'];
$res = M("company_game_ratio_log","tab_")->where("id='{$id}'")->delete();
if($res !== false){
addOperationLog(['op_type'=>2,'key'=>$id,'op_name'=>'删除','url'=>U('lists')]);
$this->ajaxReturn(["msg"=>"删除成功","code"=>1,"url"=>U("lists")]);
}else{
$this->error('删除错误');
}
}
public function delGameRatio()
{
if(!isset($_REQUEST['id'])){
$this->error('参数错误');
}
$id = $_REQUEST['id'];
$res = M("company_game_ratio","tab_")->where("id='{$id}'")->delete();
if($res !== false){
addOperationLog(['op_type'=>2,'key'=>$id,'op_name'=>'删除','url'=>U('index')]);
$this->ajaxReturn(["msg"=>"删除成功","code"=>1,"url"=>U("index")]);
@ -376,6 +490,7 @@ class CompanyGameRatioController extends AdminController
$this->error('删除错误');
}
}
public function menuAuth()
{
$addurl = U("addRatio");
@ -405,14 +520,19 @@ class CompanyGameRatioController extends AdminController
$opBtn = [
"editRatio"=>"<a class='confirm editRatio' data-id='{$id}'>编辑</a>",
"delRatio"=>"<a class='confirm delRatio' data-id='{$id}' style='color: red;'>删除</a>",
"delGameRatio"=>"<a class='confirm delGameRatio' data-id='{$id}' style='color: red;'>删除</a>",
];
//操作对应菜单
if($info['status'] == 2){
$optist = [];
if(!isset($info['status'])){
$optist = ["delGameRatio"];
}else{
$optist = ["editRatio","delRatio"];
if($info['status'] == 2){
$optist = [];
}else{
$optist = ["editRatio","delRatio"];
}
}
//
$resarr = [];
foreach ($optist as $k => $v) {
@ -427,6 +547,8 @@ class CompanyGameRatioController extends AdminController
return $resarr;
}
public function setTurnoverRatio($params)
{
$save['turnover_ratio'] = [];

@ -862,57 +862,64 @@ class CompanyStatementSetController extends Controller {
array_multisort($last_names,SORT_DESC,SORT_STRING,$v['statement_info']);
}
}
if($v['statement_money'] < 300){
//存未满
if($lackcompany['pay_amount'] > 0){
$lask_id = $LackStatement->add($lackcompany);
$countdata['create_lack_ids'][] =$lask_id;
$countdata['lack_statement_money'] +=$lackcompany['statement_money'];
$countdata['lack_platform_amount'] +=$lackcompany['platform_amount'];
}
if($type == 2 && $v['statement_money'] == 0){
//补点不存
}else{
if($v['pay_amount'] > 0){
//存成功配置单号
$company =[
"pool_id"=>0,
"company_id"=>$k,
"company_type"=>2,
"company_name"=>$v['partner'],
"company_info"=>json_encode($company_info,JSON_UNESCAPED_UNICODE),
"statement_money"=>$v['statement_money'],
"pay_amount"=>$v['pay_amount'],
"platform_amount"=>$v['platform_amount'],
"fine"=>$v['fine'],
"reward"=>$v['reward'],
"statement_begin_time"=>$begintime,
"statement_end_time"=>$endtime,
"statement_info"=>json_encode($v['statement_info'],JSON_UNESCAPED_UNICODE),
"statement_num"=>"JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5)
];
if($v['is_payment'] == 1){
$company['verify_status'] = 0;
}else{
$company['verify_status'] = 2;
if($v['statement_money'] < 300){
//存未满
if($lackcompany['pay_amount'] > 0){
$lask_id = $LackStatement->add($lackcompany);
$countdata['create_lack_ids'][] =$lask_id;
$countdata['lack_statement_money'] +=$lackcompany['statement_money'];
$countdata['lack_platform_amount'] +=$lackcompany['platform_amount'];
}
}else{
if($v['pay_amount'] > 0){
//存成功配置单号
$company =[
"pool_id"=>0,
"company_id"=>$k,
"company_type"=>2,
"company_name"=>$v['partner'],
"company_info"=>json_encode($company_info,JSON_UNESCAPED_UNICODE),
"statement_money"=>$v['statement_money'],
"pay_amount"=>$v['pay_amount'],
"platform_amount"=>$v['platform_amount'],
"fine"=>$v['fine'],
"reward"=>$v['reward'],
"statement_begin_time"=>$begintime,
"statement_end_time"=>$endtime,
"statement_info"=>json_encode($v['statement_info'],JSON_UNESCAPED_UNICODE),
"statement_num"=>"JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5)
];
if($v['is_payment'] == 1){
$company['verify_status'] = 0;
}else{
$company['verify_status'] = 2;
}
$companyid = $StatementInfo->add($company);
$countdata['info_ids'][] =$companyid;
$countdata['del_lack_ids'] =array_merge($countdata['del_lack_ids'],$del_lack_ids);
$countdata['statement_money'] +=$v['statement_money'];
$countdata['pay_amount'] +=$v['pay_amount'];
$countdata['platform_amount'] +=$v['platform_amount'];
$countdata['fine'] +=$v['fine'];
$countdata['reward'] +=$v['reward'];
}
$companyid = $StatementInfo->add($company);
$countdata['info_ids'][] =$companyid;
$countdata['del_lack_ids'] =array_merge($countdata['del_lack_ids'],$del_lack_ids);
$countdata['statement_money'] +=$v['statement_money'];
$countdata['pay_amount'] +=$v['pay_amount'];
$countdata['platform_amount'] +=$v['platform_amount'];
$countdata['fine'] +=$v['fine'];
$countdata['reward'] +=$v['reward'];
}
}
}
$this->savePromotateUserPool($users);
$this->savePromotateUserPool($user);
$this->savePromotateUserPool($users,$type);
$this->savePromotateUserPool($user,$type);
}
/**
* 保存信息汇总信息
*/
protected function savePromotateUserPool($data){
if(empty($data['create_lack_ids']) && empty($data['del_lack_ids']) && empty($data['info_ids'])){ return;}
if($data['statement_money'] == 0 && $type ==2){ return;}
if($data['statement_money'] == 0){
$data['verify_status'] = 5;
$data['verify_log'] = json_encode(["create_user"=>"system","create_time"=>date("Y-m-d H:i:s"),"verify_user"=>"system","verify_time"=>date("Y-m-d H:i:s"),"payment_user"=>"system","payment_time"=>date("Y-m-d H:i:s")]);

@ -52,8 +52,12 @@
<div class="cf top_nav_list">
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">推广游戏分成管理</h3>
<p class="description_text"></p>
<div class="fr">
<a class="tabchose" href="{:U('index')}">生效列表</a>
<a href="{:U('lists')}">审核列表</a>
</div>
<h3 class="page_title">推广游戏分成</h3>
<p class="description_text">删除后游戏比例将读取模板值</p>
</div>
<!-- <div class="fl button_list">
<div class="tools">
@ -82,15 +86,6 @@
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="status" name="status" class="select_gallery" >
<option value="">请选择审核状态</option>
<volist name="status" id="vo">
<option value="{$key}" <if condition="isset($_GET['status']) && $key eq I('status')">selected</if> >{$vo}</option>
</volist>
</select>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('index','&row='.I('row'),false)}">搜索</a>
@ -113,9 +108,6 @@
<!-- 表头 -->
<thead>
<tr>
<th>
<input class="check-all" type="checkbox">
</th>
<th>公司名称</th>
<th>内外团</th>
<th>结算周期</th>
@ -123,12 +115,7 @@
<th>原游戏名称</th>
<th>现游戏名称</th>
<th>生效时间</th>
<th>原比例</th>
<th>申请比例</th>
<th>创建记录</th>
<th>市场部审批</th>
<th>管理员审批</th>
<th>备注</th>
<th>分成比例</th>
<th>操作</th>
</tr>
</thead>
@ -137,14 +124,11 @@
<tbody>
<if condition = "empty($data)">
<tr>
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
<td colspan="9" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
<else/>
<volist name="data" id="data">
<tr>
<td>
<input class="ids" type="checkbox" data-status="{$data.status}" value="{$data['id']}" name="ids[]" >
</td>
<td>{$data.company_name}</td>
<td>{$data.company_belong}</td>
<td>{$data.settlement_type}</td>
@ -152,49 +136,12 @@
<td>{$data.original_package_name}</td>
<td>{$data.relation_game_name}</td>
<td>{$data.valid}</td>
<td style="line-height: 16px;text-indent: 0;">
<div style="text-align: left;width: 90%;margin-left: 5%;margin-top: 10px;margin-bottom: 10px;">
{$data.last_turnover_ratio_str}
</div>
</td>
<td style="line-height: 16px;text-indent: 0;">
<div style="text-align: left;width: 90%;margin-left: 5%;margin-top: 10px;margin-bottom: 10px;">
{$data.turnover_ratio_str}
</div>
</td>
<td>
<div style="line-height: 2;">
{$data.create}
</div>
</td>
<td>
<if condition="$data.status eq -1 ">
<div style="line-height: 2;color: red;">
{$data.market}
</div>
<else />
<div style="line-height: 2;">
{$data.market}
</div>
</if>
</td>
<td>
<if condition="$data.status eq -2 ">
<div style="line-height: 2;color: red;">
{$data.admin}
</div>
<else />
<div style="line-height: 2;">
{$data.admin}
</div>
</if>
</td>
<td>
{$data.remark}
</td>
<td>
<foreach name="data.oplist" item="vo" >
{$vo}
@ -263,14 +210,10 @@ $(function(){
$("#search").click();
}
});
$(".editRatio").on("click",function(){
var id = $(this).data("id");
var url = "{:U('editRatio')}"+"&id="+id;
window.location.href = url;
})
$(".delRatio").on("click",function(){
$(".delGameRatio").on("click",function(){
var id = $(this).data("id");
var url = "{:U('delRatio')}"+"&id="+id;
var url = "{:U('delGameRatio')}"+"&id="+id;
layer.confirm('删除后将无法恢复,请慎重选择', {
closeBtn:0,
title:false,
@ -291,70 +234,6 @@ $(function(){
});
})
$("#marketAgree,#marketRefuse,#adminAgree,#adminRefuse").on("click",function(){
var id = $(this).attr("id");
if(id == "marketAgree"){
var opname = "市场部审批通过";
var opurl = "{:U('marketAgree')}";
var opst ="[未进行审批]";
var status = 0;
}else if(id=="marketRefuse"){
var opname = "市场部审批拒绝";
var opurl = "{:U('marketRefuse')}";
var opst ="[未进行审批]";
var status = 0;
}else if(id=="adminAgree"){
var opname = "管理员审批通过";
var opurl = "{:U('adminAgree')}";
var opst ="[市场部审批通过]";
var status = 1;
}else if(id=="adminRefuse"){
var opname = "管理员审批拒绝";
var opurl = "{:U('adminRefuse')}";
var opst ="[市场部审批通过]";
var status = 1;
}
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if($(elem).data("status") != status){
flag = true;
}else{
return $(elem).val();
}
}).get().join(",");
if(text == ''){
layer.msg("<font style='color:white'>" + '无需要'+opname+'的申请,仅'+opst+'状态可以进行'+opname+"</font>");
return;
}
if(flag){
layer.confirm(opname+"仅会对"+opst+"的申请进行处理,选择中包含其他的状态的申请将被忽略,点击取消停止操作",{title:false}, function(index){
_doAgreeApply();
layer.close(index);
});
}else{
_doAgreeApply();
}
function _doAgreeApply(){
//执行
$.ajax({
type: "POST",
url: opurl,
dataType: 'json',
async: false,
data: {ids:text},
success:function(data){
if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}
}
});
}
})
})

@ -0,0 +1,367 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
<script src="__STATIC__/jquery.form.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js"></script>
<link rel="stylesheet" href="__CSS__/promote.css" type="text/css"/>
<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}
.butnbox {padding:10px 0 10px;}
.butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
.butnbox .butnlist .butn {display:inline-block;width:120px;height:28px;line-height:28px;text-align:center;color:#FFF;background:#3C95C8;border-radius:3px;}
.butnbox .butnlist .butn.last {background:#009900;}
.butnbox .butnlist .butn~.butn {margin-left:20px;}
.butnbox a{
cursor:pointer
}
.data_list table tbody tr a.disabled,.data_list table tbody tr a.disabled:hover {color:#999;cursor:default;}
.layui-layer-title {
text-align: center;
height: 80px;
line-height: 80px;
font-weight: 600;
font-size: 18px;
}
</style>
<div class="cf top_nav_list">
<div class="cf main-place top_nav_list navtab_list">
<div class="fr">
<a href="{:U('index')}">生效列表</a>
<a class="tabchose" href="{:U('lists')}">审核列表</a>
</div>
<h3 class="page_title">推广游戏分成审核列表</h3>
<p class="description_text">如需修改已审核完成的游戏分成,请新增一个分成进行审核,未审核通过的,请直接编辑</p>
</div>
<!-- <div class="fl button_list">
<div class="tools">
<a class=" " href="{:U('add')}"><span class="button_icon button_icon1"></span>新增推广游戏分成</a>
</div>
</div> -->
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list" style="margin-bottom:12px">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="company_id" name="company_id" class="select_gallery" >
<option value="">请选择公司</option>
<volist name="companyList" id="vo">
<option value="{$vo.id}" <if condition="$vo.id eq I('company_id')">selected</if> >{$vo.company_name}</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="relation_game_id" name="relation_game_id" class="select_gallery" >
<option value="">现包名</option>
<volist name="gameList" id="vo">
<option value="{$vo.relation_game_id}" <if condition="$vo.relation_game_id eq I('relation_game_id')">selected</if> >{$vo.relation_game_name}</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="status" name="status" class="select_gallery" >
<option value="">请选择审核状态</option>
<volist name="status" id="vo">
<option value="{$key}" <if condition="isset($_GET['status']) && $key eq I('status')">selected</if> >{$vo}</option>
</volist>
</select>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('index','&row='.I('row'),false)}">搜索</a>
</div>
</div>
</div>
<div class="butnbox" style="margin-bottom: 10px;">
<div class="butnlist jscheckbutn" style="margin-left: 2px">
<foreach name="menubtn" item="vo" >
{$vo}
</foreach>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>
<input class="check-all" type="checkbox">
</th>
<th>公司名称</th>
<th>内外团</th>
<th>结算周期</th>
<th>游戏类型</th>
<th>原游戏名称</th>
<th>现游戏名称</th>
<th>生效时间</th>
<th>原比例</th>
<th>申请比例</th>
<th>创建记录</th>
<th>市场部审批</th>
<th>管理员审批</th>
<th>备注</th>
<th>操作</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<if condition = "empty($data)">
<tr>
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
<else/>
<volist name="data" id="data">
<tr>
<td>
<input class="ids" type="checkbox" data-status="{$data.status}" value="{$data['id']}" name="ids[]" >
</td>
<td>{$data.company_name}</td>
<td>{$data.company_belong}</td>
<td>{$data.settlement_type}</td>
<td>{$data.game_type_name}</td>
<td>{$data.original_package_name}</td>
<td>{$data.relation_game_name}</td>
<td>{$data.valid}</td>
<td style="line-height: 16px;text-indent: 0;">
<div style="text-align: left;width: 90%;margin-left: 5%;margin-top: 10px;margin-bottom: 10px;">
{$data.last_turnover_ratio_str}
</div>
</td>
<td style="line-height: 16px;text-indent: 0;">
<div style="text-align: left;width: 90%;margin-left: 5%;margin-top: 10px;margin-bottom: 10px;">
{$data.turnover_ratio_str}
</div>
</td>
<td>
<div style="line-height: 2;">
{$data.create}
</div>
</td>
<td>
<if condition="$data.status eq -1 ">
<div style="line-height: 2;color: red;">
{$data.market}
</div>
<else />
<div style="line-height: 2;">
{$data.market}
</div>
</if>
</td>
<td>
<if condition="$data.status eq -2 ">
<div style="line-height: 2;color: red;">
{$data.admin}
</div>
<else />
<div style="line-height: 2;">
{$data.admin}
</div>
</if>
</td>
<td>
{$data.remark}
</td>
<td>
<foreach name="data.oplist" item="vo" >
{$vo}
</foreach>
</td>
</tr>
</volist>
</if>
</tbody>
</table>
</div>
</div>
<div class="page">
<if condition="$role_export_check eq true ">
<a class="sch-btn export-btn"
href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a>
</if>
{$_page|default=''}
</div>
<!--弹出层-->
<div class="promote-layer mb20">
<form id="ajaxForm" action="{:U('set_withdraw')}" method="post">
<ol class="promote-con">
<li class="promote-con-con " id="deny">
<div class="mb20">
<span class="promote-name">备注:</span>
<textarea class="textarea-style" name="remark" id="remark"></textarea>
</div>
<a class="ajax-post pack" style="cursor: pointer;" target-form="ids" url="{:U('setStatus',array('status'=>-1))}"><div class="promote-btn">拒绝</div></a>
</li>
</ol>
</form>
</div>
</block>
<block name="script">
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('index')}");
$(function(){
//搜索功能
$("#search").click(function(){
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&"+$('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
window.location.href = url;
});
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
$(".editRatio").on("click",function(){
var id = $(this).data("id");
var url = "{:U('editRatio')}"+"&id="+id;
window.location.href = url;
})
$(".delRatio").on("click",function(){
var id = $(this).data("id");
var url = "{:U('delRatio')}"+"&id="+id;
layer.confirm('删除后将无法恢复,请慎重选择', {
closeBtn:0,
title:false,
btn: ['取消','删除'] //按钮
}, function(index){
layer.close(index);
}, function(){
$.get(url,function(data){
if(data.code == 1){
layer.msg('<span style="color:white">'+data.msg+'<span>',{time: 1000},function(){
window.location.reload();
});
}else{
layer.msg(data.msg,{icon: 2});
}
});
});
})
$("#marketAgree,#marketRefuse,#adminAgree,#adminRefuse").on("click",function(){
var id = $(this).attr("id");
if(id == "marketAgree"){
var opname = "市场部审批通过";
var opurl = "{:U('marketAgree')}";
var opst ="[未进行审批]";
var status = 0;
}else if(id=="marketRefuse"){
var opname = "市场部审批拒绝";
var opurl = "{:U('marketRefuse')}";
var opst ="[未进行审批]";
var status = 0;
}else if(id=="adminAgree"){
var opname = "管理员审批通过";
var opurl = "{:U('adminAgree')}";
var opst ="[市场部审批通过]";
var status = 1;
}else if(id=="adminRefuse"){
var opname = "管理员审批拒绝";
var opurl = "{:U('adminRefuse')}";
var opst ="[市场部审批通过]";
var status = 1;
}
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if($(elem).data("status") != status){
flag = true;
}else{
return $(elem).val();
}
}).get().join(",");
if(text == ''){
layer.msg("<font style='color:white'>" + '无需要'+opname+'的申请,仅'+opst+'状态可以进行'+opname+"</font>");
return;
}
if(flag){
layer.confirm(opname+"仅会对"+opst+"的申请进行处理,选择中包含其他的状态的申请将被忽略,点击取消停止操作",{title:false}, function(index){
_doAgreeApply();
layer.close(index);
});
}else{
_doAgreeApply();
}
function _doAgreeApply(){
//执行
$.ajax({
type: "POST",
url: opurl,
dataType: 'json',
async: false,
data: {ids:text},
success:function(data){
if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}
}
});
}
})
})
</script>
</block>

@ -0,0 +1,14 @@
<?php
namespace Payment\Controller;
/**
* 后台首页控制器
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
*/
class IndexController extends BaseController
{
public function index()
{
$this->redirect('Payment/lists');
}
}

@ -17,6 +17,18 @@ class PaymentController extends BaseController
"2"=>"下游个人",
"3"=>"上游CP"
];
public $ALIRSP=[
"out_biz_no"=>"商户订单号",
"order_id"=>"支付订单号",
"pay_fund_order_id"=>"资金流水号",
"status"=>"转账状态",
"trans_date"=>"订单支付时间",
"msg"=>"支付信息",
"sub_msg"=>"失败描述",
"sub_code"=>"失败码",
"remark"=>"打款备注",
"code"=>"打款状态码"
];
public function _initialize()
{
$this->admininfo = session('payment_user');;
@ -118,7 +130,7 @@ class PaymentController extends BaseController
if ($page) {
$this->assign('_page', $page);
}
$this->meta_title = '打款结算单';
$this->assign("data",$CompanyInfo);
$this->assign("money",$money);
$this->assign("CompanyType", $this->CompanyType);
@ -480,6 +492,28 @@ class PaymentController extends BaseController
}
}
$this->ajaxReturn(["success"=>"打款成功","data"=>[]]);
}
/**
* 打款详情
*/
public function paymentInfo()
{
if(!isset($_REQUEST['id'])) $this->error("参数错误");
$id = $_REQUEST['id'];
$info = M("company_statement_info","tab_")->field("pay_info")->where("id='{$id}'")->find()['pay_info'];
$info = json_decode($info,true);
$senddata = [];
foreach($info as $k => &$v){
if(isset($this->ALIRSP[$k])){
$senddata[$this->ALIRSP[$k]] = $v;
}else{
$senddata[$k] = $v;
}
}
$this->assign("info",$senddata);
$this->display();
}
protected function setOneVerifyStatus($change_status,$op_pre,$id)
{

@ -224,7 +224,7 @@
<td>
<a class='confirm viewPool' data-id='{$data.id}'>查看</a>
<if condition="$data['pay_status'] neq 0">
<a class='confirm viewPayment' data-id='{$data.id}'>打款详情</a>
<a class='confirm paymentInfo' data-id='{$data.id}'>打款详情</a>
</if>
</td>
</tr>
@ -310,6 +310,19 @@
content: url
});
});
$(".paymentInfo").on("click",function(){
var id = $(this).data("id");
var url = "{:U('paymentInfo')}"+"&id="+id
layer.open({
type: 2,
title: "打款详情",
shadeClose: true,
shade: 0.8,
area: ['20%', '60%'],
content: url
});
})
$("#doPayment").on("click",function(){
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if($(elem).data("pay") == 1){

@ -0,0 +1,67 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title></title>
<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__/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__/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>
<script src="__STATIC__/table2excel.js"></script>
</head>
<style>
html {
min-width:100%;
}
body {
padding: 0px 10px 150px 10px;
/* width: 960px; */
}
</style>
<body>
<div class="tab-wrap">
<div class="tab-content tabcon1711 tabcon17112">
<div id="tab1" class="tab-pane in tab1">
<form action="{:U('saveTool')}" method="post" class="form-horizontal qq_login form_info_ml">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<foreach name="info" item="v" key="k">
<tr>
<td class="l noticeinfo">{$k}:</td>
<td class="r table_radio">
{$v}
<!-- <input type="text" class="text input-large" value="{$wechat_url}"> -->
<!-- <span class="notice-text">请将此地址复制到微信公众平台接口URL项</span> -->
</td>
</tr>
</foreach>
</tbody>
</table>
</form>
</div>
</div>
</div>
<body>
<script type="text/javascript">
</script>
</html>

@ -1947,7 +1947,7 @@ CREATE TABLE `tab_company_statement_info` (
`pay_status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '打款状态 -1:打款失败 0:未打款 1:打款成功',
`pay_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '支付完成时间',
`pay_type` tinyint(2) NOT NULL DEFAULT '0' COMMENT '打款类型 1提现 2线上打款 3线下打款',
`pay_info` text NOT NULL COMMENT '打款信息',
`pay_info` text COMMENT '打款信息',
`remark` varchar(255) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '备注',
PRIMARY KEY (`id`),

Loading…
Cancel
Save