Merge remote-tracking branch 'origin/feature/admin_optimize' into feature/admin_optimize

master
zhengyongxing 5 years ago
commit 46ccf0e3ce

@ -37,27 +37,208 @@ class PartnerController extends ThinkController
$row = intval(I('row', 0));
$row = empty($row) ? 10 : $row;//每页条数
$data = $model->alias('p')
->field('p.id,p.partner,p.status,p.create_time,link_man,link_phone,address,company_tax_no,payee_name,
bank_account,opening_bank,m.nickname')
->join('left join sys_member as m on m.uid = p.uid')
//获取分页数据
$partners = $model->alias('p')
->field("p.partner,p.matche_platform,p.invoice_rate,p.settlement_type,p.bank_account,
p.opening_bank,p.id,p.contract_start_time,p.contract_end_time,p.remark")
->where($map)
->order('id desc')
->page($page, $row)
->order("id desc")
->page($page,$row)
->select();
//获取公司id
$partner_ids = array_column($partners, 'id');
$game_map['partner_id'] = ["in",$partner_ids];
$games = M("game","tab_")->alias('g')
->field("g.game_type_name,g.relation_game_name,g.original_package_name,g.partner_id,g.id")
->where($game_map)
->select();
$game_ids = array_column($games, 'id');
$cp_game_ratio_map['game_id'] = ["in", $game_ids];
$cp_game_ratio_map['is_del'] = '0';
//获取游戏比例
$gameradiores = M("cp_game_ratio","tab_")
->alias("cg")
->field("cg.ratio,cg.instanceof,cg.game_id,cg.begin_total_amount")
->where($cp_game_ratio_map)
->select();
// dd($cp_game_ratio_map);
$parseGameRadiores = array();
foreach ($gameradiores as $key =>$val) {
if ($val['begin_total_amount'] == 0) {
$val['name'] = '默认比例';
} else {
if($val['instanceof']=='1'){
$val['name']="月流水≥".$val['begin_total_amount'];
}else{
$val['name']="月流水>".$val['begin_total_amount'];
}
}
$val['row'] = 1;
$parseGameRadiores[$val['game_id']][] = $val;
}
// dd($parseGameRadiores);
$parseGames = array();
foreach ($games as $key =>$val) {
$val['game_ratio'] = $parseGameRadiores[$val['id']];
if(array_key_exists($val['id'],$parseGameRadiores)){//游戏有比例
$row2 = array_sum(array_column($val['game_ratio'], 'row')) ;
$val['row'] = empty($row2) ? 1: $row2;
} else {
$val["row"] = 1;
}
$parseGames[$val['partner_id']][] = $val;
}
$parseData = array();
foreach ($partners as $key =>$value) {
$value['game'] = $parseGames[$value['id']];
$value['has_game_evidence'] = $parseGames['has_game_evidence'] ? '有' : '没有';
$value['is_sign_contract'] = $parseGames['is_sign_contract'] ? '是' : '否';
if ($value['settlement_type'] == 0) {
$value['settlement_type'] = '未配置';
} elseif ($value['settlement_type'] == 1) {
$value['settlement_type'] = '周结';
} elseif ($value['settlement_type'] == 2) {
$value['settlement_type'] = '月结';
}
$value['contract_time'] = time_format($value['contract_start_time'], 'Y/m/d') . '-' .
time_format($value['contract_end_time'], 'Y/m/d');
$row2 = array_sum(array_column($value['game'], 'row')) ;
$value['row'] = empty($row2) ? 1: $row2;
$parseData[$value['partner_id']][] = $value;
}
$parseData = array_values($parseData);
/* 查询记录总数 */
$count = $model
->where($map)
->count();
//分页
$parameter['p'] = $page;
$parameter['row'] = $row;
$page = set_pagination($count, $row, $parameter);
if ($page) {
$this->assign('_page', $page);
}
// dd($parseData[0]);
$this->assign('listData', $parseData[0]);
$this->assign('count', $count);
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Partner/lists'])->find());
$this->meta_title = '合作方管理';
$this->display();
}
if (!empty($data)) {
foreach ($data as &$list) {
$list['status'] = ($list['status'] == 0) ? '已关闭' : '已开启';
$list['create_time'] = date('Y-m-d H:i:s', $list['create_time']);
//列表
public function lists2()
{
$model = M($this->modelName, 'tab_');
$map = [];
$id = intval(I('id', 0));
if (!empty($id)) {
$map['tab_partner.id'] = $id;
$parameter['id'] = $id;
}
if (isset($_REQUEST['status']) && $_REQUEST['status'] !== '') {
$status = intval($_REQUEST['status']);
$map['tab_partner.status'] = $status;
$parameter['status'] = $status;
}
$page = intval(I('get.p', 0));
$page = $page ? $page : 1; //默认显示第一页数据
$row = intval(I('row', 0));
$row = empty($row) ? 10 : $row;//每页条数
//获取分页数据
$partners = $model->alias('p')
->field("p.partner,p.matche_platform,p.invoice_rate,p.settlement_type,p.bank_account,
p.opening_bank,p.id,p.contract_start_time,p.contract_end_time,p.remark")
->where($map)
->order("id desc")
->page($page,$row)
->select();
//获取公司id
$partner_ids = implode(',', array_column($partners, 'id'));
$game_map['partner_id'] = ["in",$partner_ids];
$games = M("game","tab_")->alias('g')
->field("g.game_type_name,g.relation_game_name,g.original_package_name,g.partner_id,g.id")
->where($game_map)
->select();
$game_ids = implode(',', array_column($games, 'id'));
$cp_game_ratio_map['game_id'] = ["in",$game_ids];
//获取游戏比例
$gameradiores = M("cp_game_ratio","tab_")
->alias("cg")
->field("cg.ratio,cg.instanceof,cg.game_id")
->join("tab_game ga ON cg.game_id = ga.id")
->where($cp_game_ratio_map)
->where(['is_del' => 0])
->group("game_id")
->select();
$parseGameRadiores = array();
foreach ($gameradiores as $key =>$val) {
$val['row'] = 1;
$parseGameRadiores[$val['game_id']][] = $val;
}
$parseGames = array();
foreach ($games as $key =>$val) {
$val['game_ratio'] = $parseGameRadiores[$val['id']];
if(array_key_exists($val['id'],$parseGameRadiores)){//游戏有比例
$row = array_sum(array_column($val['game_ratio'], 'row')) ;
$val['row'] = empty($row) ? 1: $row;
} else {
$val["row"] = 1;
}
$parseGames[$val['partner_id']][] = $val;
}
$parseData = array();
foreach ($partners as $key =>$value) {
$value['game'] = $parseGames[$value['id']];
$value['has_game_evidence'] = $parseGames['has_game_evidence'] ? '有' : '没有';
$value['is_sign_contract'] = $parseGames['is_sign_contract'] ? '是' : '否';
if ($value['settlement_type'] == 0) {
$value['settlement_type'] = '未配置';
} elseif ($value['settlement_type'] == 1) {
$value['settlement_type'] = '周结';
} elseif ($value['settlement_type'] == 2) {
$value['settlement_type'] = '月结';
}
$value['contract_time'] = time_format($value['contract_start_time'], 'Y/m/d') . '-' .
time_format($value['contract_end_time'], 'Y/m/d');
$row = array_sum(array_column($value['game'], 'row')) ;
$value['row'] = empty($row) ? 1: $row;
$parseData[$value['partner_id']][] = $value;
}
$parseData = array_values($parseData);
// dd($parseData);
/* 查询记录总数 */
$count = $model
->where($map)
->count();
//分页
$parameter['p'] = $page;
$parameter['row'] = $row;
@ -66,7 +247,7 @@ class PartnerController extends ThinkController
$this->assign('_page', $page);
}
$this->assign('listData', $data);
$this->assign('listData', $parseData[0]);
$this->assign('count', $count);
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Partner/lists'])->find());
$this->meta_title = '合作方管理';
@ -77,7 +258,6 @@ class PartnerController extends ThinkController
public function add()
{
if ($_POST) {
dd($_REQUEST);
$partner = I('post.partner', '');
$status = intval(I('post.status', 1));
@ -124,13 +304,13 @@ class PartnerController extends ThinkController
$save['contract_start_time'] = strtotime(I('contract_start_time'));
$save['contract_end_time'] = strtotime(I('contract_end_time'));
$save['channel_rate'] = I('channel_rate');
$save['invoice_rate'] = I('invoice_rate');
$save['invoice_rate'] = I('invoice_rate') ?: 0;
$save['is_sign_contract'] = I('is_sign_contract');
$save['settlement_type'] = I('settlement_type');
$save['has_game_evidence'] = I('has_game_evidence');
$save['remark'] = I('remark');
if (isset($save['file_info'])) {
$save['file_info'] = json_encode($save['file_info'],JSON_UNESCAPED_UNICODE);
if (!empty(I('file_info'))) {
$save['file_info'] = I('file_info');
}
$save['uid'] = UID;
@ -170,9 +350,6 @@ class PartnerController extends ThinkController
if (empty(I('link_phone'))) {
$this->error('请输入联系电话');
}
if (!in_array($status, [0, 1]) || $id == 0) {
$this->error('参数异常');
}
$data = $model
->field('id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank')
@ -183,6 +360,7 @@ class PartnerController extends ThinkController
$map['partner'] = $partner;
$res = $model->where($map)->getField('id');
dd($res);
if ($res && $res != $id) {
$this->error('合作方已存在');
}
@ -210,6 +388,19 @@ class PartnerController extends ThinkController
$save['bank_account'] = I('bank_account');
$save['opening_bank'] = I('opening_bank');
$save['matche_platform'] = I('matche_platform');
$save['contract_start_time'] = strtotime(I('contract_start_time'));
$save['contract_end_time'] = strtotime(I('contract_end_time'));
$save['channel_rate'] = I('channel_rate');
$save['invoice_rate'] = I('invoice_rate') ?: 0;
$save['is_sign_contract'] = I('is_sign_contract');
$save['settlement_type'] = I('settlement_type');
$save['has_game_evidence'] = I('has_game_evidence');
$save['remark'] = I('remark');
if (!empty(I('file_info'))) {
$save['file_info'] = I('file_info');
}
$save['status'] = $status;
$save['last_up_time'] = $time;
$res = $model->save($save);
@ -223,16 +414,19 @@ class PartnerController extends ThinkController
$id = intval(I('get.id', 0));
$map['id'] = $id;
$data = $model
->field('id,partner,status,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank')
->find($id);
if (empty($data)) {
$this->error('数据异常', U('lists'));
}
$this->assign('config', $data);
$data['contract_start_time'] = date('Y-m-d', $data['contract_start_time']);
$data['contract_end_time'] = date('Y-m-d', $data['contract_end_time']);
// dd($data);
$this->assign('data', $data);
$action = I('action');
$this->assign('action', $action);
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Partner/edit'])->find());
$this->meta_title = '编辑合作方';
$this->display();
$this->meta_title = $action ? '查看合作方' : '编辑合作方';
$this->display($action);
}
}

@ -110,6 +110,8 @@ class StatementController extends ThinkController
$Statement = M("statement","tab_");
$repart =false;
$errorstr = '';
$errorstr1 = '';
$errorstr2 = '';
//开始时间被重叠部分
$checkmap = array(
"statement_begin_time"=>array("ELT",strtotime($_REQUEST['time_start'])),
@ -126,7 +128,7 @@ class StatementController extends ThinkController
}else{
$end = $_REQUEST['time_end'];
}
$errorstr .= ($begin."到".$end."期间的数据已经结算过<br/>");
$errorstr = ($begin."到".$end."期间的数据已经结算过<br/>");
}
//结束被重复的部分
$checkmap = array(
@ -134,18 +136,41 @@ class StatementController extends ThinkController
"statement_end_time"=>array("EGT",strtotime($_REQUEST['time_end'])),
"company_id"=>$CompanyId
);
if($repart){
$checkmap["id"]=array("NEQ",$bres["id"]);
}
$bres = $Statement->field("statement_begin_time,statement_end_time")->where($checkmap)->find();
if($bres){
$repart=true;
$begin = date("Y-m-d",$bres["statement_begin_time"]);
//统计相交时间
$end = $_REQUEST['time_end'];
$errorstr .= ($begin."到".$end."期间的数据已经结算过<br/>");
$errorstr1 = ($begin."到".$end."期间的数据已经结算过<br/>");
}
//中间被包住
$checkmap = array(
"statement_begin_time"=>array("EGT",strtotime($_REQUEST['time_start'])),
"statement_end_time"=>array("ELT",strtotime($_REQUEST['time_end'])),
"company_id"=>$CompanyId
);
$bres = $Statement->field("statement_begin_time,statement_end_time")->where($checkmap)->find();
if($bres){
$repart=true;
$begin = date("Y-m-d",$bres["statement_begin_time"]);
//统计相交时间
$end = date("Y-m-d",$bres["statement_end_time"]);
$errorstr2 = ($begin."到".$end."期间的数据已经结算过<br/>");
}
if($repart){
if($errorstr1 == $errorstr){
$errorstr1 ='';
}
if($errorstr1 == $errorstr2){
$errorstr1 ='';
}
if($errorstr == $errorstr2){
$errorstr2 ='';
}
$errorstr .=($errorstr1.$errorstr2);
$this->ajaxReturn(array("error"=>$errorstr,"code"=>2001));
}

@ -245,7 +245,7 @@
<if condition="I('type') eq 2">
<td >{:get_registertype($data['register_type'])}</td>
<td >
<!-- <if condition="$is_admin eq true ">
<if condition="$show_data_power eq true ">
{$data.account}
<else />
{$data.account|encryptStr}

@ -54,14 +54,14 @@
<tr>
<td class="l"><!--<i class="mustmark" style="margin-left:-7px">*</i>-->渠道费率:</td>
<td class="r" >
<input type="text" class="txt " name="channel_rate" value="" placeholder="请输入渠道费率">%
<input type="text" class="txt " name="channel_rate" value="" placeholder="请输入渠道费率"> <span style="margin-left: 3px;padding-top: 5px">%</span>
</td>
</tr>
<tr>
<td class="l"><!--<i class="mustmark" style="margin-left:-7px">*</i>-->开票税点:</td>
<td class="r" >
<input type="text" class="txt " name="inoice_rate" value="" placeholder="请输入开票税点">
<input type="text" class="txt " name="invoice_rate" value="" placeholder="请输入开票税点">
</td>
</tr>

@ -14,7 +14,7 @@
<script type="text/javascript" src="__STATIC__/webuploader/webuploader.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__/juicer-min.js" type="text/javascript"></script>
<!-- 标签页导航 -->
<div class="tab-wrap">
@ -30,12 +30,76 @@
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>合作方名称:</td>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>同合作方名称:</td>
<td class="r" >
<input type="text" class="txt " name="partner" value="{$data.partner}" placeholder="请输入合作方名称">
</td>
</tr>
<tr>
<td class="l"><!--<i class="mustmark" style="margin-left:-7px">*</i>-->对应平台(简称)</td>
<td class="r" >
<input type="text" class="txt " name="matche_platform" value="{$data.matche_platform}" placeholder="请输入对应平台">
</td>
</tr>
<tr>
<td class="l">合同期限:</td>
<td class="r">
<input type="text" class="txt time time1" name="contract_start_time" value="{$data.contract_start_time}" placeholder="请选择开始时间">
-<input type="text" class="txt time time2" name="contract_end_time" value="{$data.contract_end_time}" placeholder="请选择结束时间">
</td>
</tr>
<tr>
<td class="l"><!--<i class="mustmark" style="margin-left:-7px">*</i>-->渠道费率:</td>
<td class="r" >
<input type="text" class="txt " name="channel_rate" value="{$data.channel_rate}" placeholder="请输入渠道费率"> <span style="margin-left: 3px;padding-top: 5px">%</span>
</td>
</tr>
<tr>
<td class="l"><!--<i class="mustmark" style="margin-left:-7px">*</i>-->开票税点:</td>
<td class="r" >
<input type="text" class="txt " name="invoice_rate" value="{$data.invoice_rate}" placeholder="请输入开票税点">
</td>
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>是否签署合同:</td>
<td class="r">
<select name="is_sign_contract" class="select_gallery">
<option value="">请选择是否签署合同</option>
<option value="1" <if condition="$data['is_sign_contract'] eq '1'"> selected="selected"</if>>是</option>
<option value="0" <if condition="$data['is_sign_contract'] eq '0'"> selected="selected"</if>>否</option>
</select>
</td>
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>结算方式:</td>
<td class="r">
<select name="settlement_type" class="select_gallery">
<option value="0">请选择结算方式</option>
<option value="1" <if condition="$data['settlement_type'] eq '1'"> selected="selected"</if>>周结</option>
<option value="2" <if condition="$data['settlement_type'] eq '2'"> selected="selected"</if>>月结</option>
</select>
</td>
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>是否签署合同:</td>
<td class="r">
<select name="has_game_evidence" class="select_gallery">
<option value="">请选择是否有游戏资质</option>
<option value="1" <if condition="$data['has_game_evidence'] eq '1'"> selected="selected"</if>>是</option>
<option value="0" <if condition="$data['has_game_evidence'] eq '0'"> selected="selected"</if>>否</option>
</select>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>联系人:</td>
<td class="r" >
@ -86,30 +150,43 @@
</td>
</tr>
<tr>
<td class="l">备注:</td>
<td class="r">
<input type="text" name="remark" class="txt" value="{$data.remark}" placeholder="请输入备注">
</td>
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>显示状态:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label>
<input type="radio" class="inp_radio" value="1" name="status"
<if condition="$data['status']==1"> checked </if>> 开启
<input type="radio" class="inp_radio" value="1" name="status" checked> 开启
</label>
<label>
<input type="radio" class="inp_radio" value="0" name="status"
<if condition="$data['status']==0"> checked </if>> 关闭
<input type="radio" class="inp_radio" value="0" name="status"> 关闭
</label>
</span>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">文档管理</td>
<td class="r table_radio">
<input type="button" class="coin-detail" data-url="{:U('Partner/addfile')}" value="添加"
style="border-radius:5%;background: #fff;color: #333;font-weight: 400;border: 1px solid #777;width: 100px;height: 35px">
</td>
</tr>
</tbody>
</table>
<table border="1" style="width: 600px;text-align: center;margin-left:50px;" cellspacing="0" cellpadding="0" id="docShow">
</table>
</div>
<div class="form-item cf">
<input type="hidden" name="id" value="{$data.id}">
<button class="submit_btn ajax-post" id="submit" type="submit" target-form="form-horizontal" style="margin-left:210px;">
保存
</button>
<input class="submit_btn ajax-post" type="button" value="保存" id="submit" target-form="form-horizontal" style="margin-left:210px;">
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="{:U('Partner/lists')}" >
返回
</a>
@ -121,19 +198,176 @@
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$meta_title}">
<input type="hidden" name="url" value="Partner/edit">
<input type="hidden" name="url" value="Partner/add">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
<script type="text/html" id="doctpl">
{@each list as it,index}
{@if index==0}
<thead>
<tr>
<th>文档名称</th>
<th>上传时间</th>
<th style="width:150px;">操作</th>
</tr>
</thead>
{@/if}
<tr>
<td style="padding:0;">${it.file_name}</td>
<td>${it.upload_time}</td>
<td>
<a class="filedown" data-index="${index}" data-path="${it.file_path}">下载</a>
<a class="filedel" data-index="${index}" data-path="${it.file_path}">删除</a>
</td>
</tr>
{@/each}
</script>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<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 type="text/javascript">
$('.time1').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
minView: "month",
startDate:new Date(),
autoclose:true
}).change(function(){
var start = new Date($(this).val()).getTime();
var end = new Date($('.time2').val()).getTime();
if(isNaN(end)) {return false;}
if(start>=end) {layer.msg('开始时间必须小于结束时间');return false;}
return false;
});
$('.time2').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
minView: "month",
startDate:new Date(),
autoclose:true
}).change(function(){
var end = new Date($(this).val()).getTime();
var start = new Date($('.time1').val()).getTime();
if(isNaN(start)) {return false;}
if(start>=end) {layer.msg('开始时间必须小于结束时间');return false;}
return false;
});
//导航高亮
highlight_subnav("{:U('Partner/lists')}");
$('#submit').click(function(){
$('#form').submit();
</script>
<script>
var doc = {$data.file_info};
if(!doc){
doc = [];
}
function addFile(info) {
doc.push(info);
layer.closeAll();
PROMOTE.juicerFun();
// window.parent.addFile(info);
}
$(".coin-detail").click(function () {
var url = $(this).data('url');
var title = '文档添加';
layer.open({
type: 2,
title: title,
shadeClose: true,
shade: 0.8,
area: ['40%', '60%'],
content: url
});
});
$("#submit").on("click",function(){
var cres = $('form').serializeArray();
//验证通过
if(doc.length > 0){
cres.push({"name":"file_info", "value":JSON.stringify(doc)});
}
console.log(cres)
//添加
$.ajax({
url:"{:U('partner/edit')}",
type:"post",
data:cres,
dataType:"json",
success:function(data){
if(data.status == 1){
layer.msg(data.info,function(){
window.location.href="{:U('partner/lists')}";
});
}else{
layer.msg(data.info);
}
},
error:function(e){
}
});
})
var PROMOTE = {
juicerFun(){
var tpl =$("#doctpl").html();
var html = juicer(tpl, {list:doc});
$("#docShow").html(html);
PROMOTE.juicerEvent();
},
juicerEvent(){
$(".filedown,.filedel").off("click");
$(".filedown").on("click",function(){
var url = window.location.protocol+"//"+window.location.host+$(this).data("path");
// window.open(url,"_blank");
var link = document.createElement('a');
link.setAttribute("download", "");
link.href = url;
link.click()
});
$(".filedel").on("click",function(){
var path = $(this).data("path");
var index = $(this).data("index");
console.log(index);
var id = 0;
$.ajax({
url:"{:U('Partner/delFile')}",
type:"post",
data:{
"id":0,
"file_path":path
},
dataType:"json",
success:function(data){
if(data.status == 1){
doc.splice(index,1)
PROMOTE.juicerFun();
}else{
layer.alert(data.info);
}
},
error:function(e){
}
});
})
}
}
PROMOTE.juicerFun();
</script>
</block>

@ -39,7 +39,7 @@
<div class="fl button_list">
<div class="tools">
<a class="" href="{:U('add')}"><span class="button_icon button_icon1"></span>新增</a>
<a class="ajax-post confirm " target-form="ids" url="{:U('del')}"><span class="button_icon button_icon2"></span>删除</a>
<!--<a class="ajax-post confirm " target-form="ids" url="{:U('del')}"><span class="button_icon button_icon2"></span>删除</a>-->
</div>
</div>
<!-- <div class="jssearch fl cf search_list" >-->
@ -64,27 +64,28 @@
<!-- 数据列表 -->
<div class="data_list data_game_list">
<div class="">
<table>
<table border="1">
<!-- 表头 -->
<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 style="width:5%;min-width:10px;">操作</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 colspan="2">合作方分成比例</th>
<th>添加人</th>
<th>添加时间</th>
<th style="width:10%;min-width:150px;">操作</th>
</tr>
</thead>
@ -95,24 +96,81 @@
<else />
<volist name="listData" id="data">
<tr>
<td><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
<td>{$data.partner}</td>
<td>{$data.status}</td>
<td>{$data.link_man}</td>
<td>{$data.link_phone}</td>
<td>{$data.address}</td>
<td>{$data.company_tax_no}</td>
<td>{$data.payee_name}</td>
<td>{$data.bank_account}</td>
<td>{$data.opening_bank}</td>
<td>{$data.nickname}</td>
<td>{$data.create_time}</td>
<td>
<td rowspan="{$data.row}">
<a href="{:U('edit',array('id'=>$data['id']))}">编辑</a>
<a href="{:U('edit',array('id'=>$data['id'],'action' => 'show'))}">查看</a>
<a href="{:U('del',array('id'=>$data['id']))}" class="confirm ajax-get">删除</a>
</td>
<td rowspan="{$data.row}">{$data.partner}</td>
<td rowspan="{$data.row}">{$data.matche_platform}</td>
<td rowspan="{$data.row}">{$data.contract_time}</td>
<td rowspan="{$data.row}">{$data.invoice_rate}%</td>
<td rowspan="{$data.row}">{$data.settlement_type}</td>
<td rowspan="{$data.row}">{$data.bank_account}</td>
<td rowspan="{$data.row}">{$data.opening_bank}</td>
<td rowspan="{$data.row}">{$data.remark}</td>
<td rowspan="{$data.row}">{$data.has_game_evidence}</td>
<td rowspan="{$data.row}">{$data.is_sign_contract}</td>
<notempty name="data.game">
<foreach name="data['game']" item="game" key="gamekey">
<if condition="$gamekey gt 0">
<tr>
<td rowspan="{$game.row}">{$game['game_type_name']}</td>
<td rowspan="{$game.row}">{$game['original_package_name']}</td>
<td rowspan="{$game.row}">{$game['relation_game_name']}</td>
<notempty name="game.game_ratio">
<foreach name="game['game_ratio']" item="ratio" key="ratiokey">
<if condition="$ratiokey gt 0">
<tr>
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</tr>
<else />
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</if>
</foreach>
<else />
<td >-</td>
<td>-</td>
</notempty>
</tr>
<else />
<td rowspan="{$game.row}">{$game['game_type_name']}</td>
<td rowspan="{$game.row}">{$game['original_package_name']}</td>
<td rowspan="{$game.row}">{$game['relation_game_name']}</td>
<notempty name="game.game_ratio">
<foreach name="game['game_ratio']" item="ratio" key="ratiokey">
<if condition="$ratiokey gt 0">
<tr>
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</tr>
<else />
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</if>
</foreach>
<else />
<td >-</td>
<td>-</td>
</notempty>
</if>
</foreach>
<else />
<td rowspan="{$data.row}">-</td>
<td rowspan="{$data.row}">-</td>
<td rowspan="{$data.row}">-</td>
<td rowspan="{$data.row}">-</td>
<td rowspan="{$data.row}">-</td>
</notempty>
</tr>
</volist>
</empty>

@ -0,0 +1,341 @@
<extend name="Public/base" />
<block name="css">
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<link rel="stylesheet" type="text/css" href="__STATIC__/webuploader/webuploader.css" media="all">
<style>
#form .txt_area.download_url {width:400px;}
.tabcon1711 .table_radio2 .table_btn {width:215px;}
</style>
</block>
<block name="body">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<script src="__STATIC__/md5.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="__STATIC__/webuploader/webuploader.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__/juicer-min.js" type="text/javascript"></script>
<!-- 标签页导航 -->
<div class="tab-wrap">
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
</div>
<div class="tab-content tabcon1711">
<!-- 表单 -->
<form id="form" action="{:U('add')}" method="post" class="form-horizontal">
<!-- 基础 -->
<div id="tab1" class="tab-pane in tab1 ">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>合同合作方名称:</td>
<td class="r" >
<input type="text" class="txt " name="partner" value="{$data.partner}" placeholder="请输入合作方名称" readonly>
</td>
</tr>
<tr>
<td class="l"><!--<i class="mustmark" style="margin-left:-7px">*</i>-->对应平台(简称)</td>
<td class="r" >
<input type="text" class="txt " name="matche_platform" value="{$data.matche_platform}" placeholder="请输入对应平台" readonly>
</td>
</tr>
<tr>
<td class="l">合同期限:</td>
<td class="r">
<input type="text" class="txt time time1" name="contract_start_time" value="{$data.contract_start_time}" placeholder="请选择开始时间" readonly>
-<input type="text" class="txt time time2" name="contract_end_time" value="{$data.contract_end_time}" placeholder="请选择结束时间" readonly>
</td>
</tr>
<tr>
<td class="l"><!--<i class="mustmark" style="margin-left:-7px">*</i>-->渠道费率:</td>
<td class="r" >
<input type="text" class="txt " name="channel_rate" value="{$data.channel_rate}" placeholder="请输入渠道费率" readonly> <span style="margin-left: 3px;padding-top: 5px">%</span>
</td>
</tr>
<tr>
<td class="l"><!--<i class="mustmark" style="margin-left:-7px">*</i>-->开票税点:</td>
<td class="r" >
<input type="text" class="txt " name="inoice_rate" value="{$data.inoice_rate}" placeholder="请输入开票税点" readonly>
</td>
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>是否签署合同:</td>
<td class="r">
<select name="is_sign_contract" class="select_gallery" disabled="true">
<option value="">请选择是否签署合同</option>
<option value="1" <if condition="$data['is_sign_contract'] eq '1'"> selected="selected"</if>>是</option>
<option value="0" <if condition="$data['is_sign_contract'] eq '0'"> selected="selected"</if>>否</option>
</select>
</td>
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>结算方式:</td>
<td class="r">
<select name="settlement_type" class="select_gallery" disabled="true">
<option value="0">请选择结算方式</option>
<option value="1" <if condition="$data['settlement_type'] eq '1'"> selected="selected"</if>>周结</option>
<option value="2" <if condition="$data['settlement_type'] eq '2'"> selected="selected"</if>>月结</option>
</select>
</td>
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>是否签署合同:</td>
<td class="r">
<select name="has_game_evidence" class="select_gallery" disabled="true">
<option value="">请选择是否有游戏资质</option>
<option value="1" <if condition="$data['has_game_evidence'] eq '1'"> selected="selected"</if>>是</option>
<option value="0" <if condition="$data['has_game_evidence'] eq '0'"> selected="selected"</if>>否</option>
</select>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>联系人:</td>
<td class="r" >
<input type="text" class="txt " name="link_man" value="{$data.link_man}" placeholder="请输入联系人" readonly>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>联系电话:</td>
<td class="r" >
<input type="text" class="txt " name="link_phone" value="{$data.link_phone}" placeholder="请输入联系电话" readonly>
</td>
</tr>
<tr>
<td class="l">邮寄地址:</td>
<td class="r" >
<input type="text" class="txt " name="address" value="{$data.address}" placeholder="请输入邮寄地址" readonly>
</td>
</tr>
<tr>
<td class="l">公司税号:</td>
<td class="r" >
<input type="text" class="txt " name="company_tax_no" value="{$data.company_tax_no}" placeholder="请输入公司税号" readonly>
</td>
</tr>
<tr>
<td class="l">收款方名称:</td>
<td class="r" >
<input type="text" class="txt " name="payee_name" value="{$data.payee_name}" placeholder="请输入收款方名称" readonly>
</td>
</tr>
<tr>
<td class="l">银行账号:</td>
<td class="r" >
<input type="text" class="txt " name="bank_account" value="{$data.bank_account}" placeholder="请输入银行账号" readonly>
</td>
</tr>
<tr>
<td class="l">开户行:</td>
<td class="r" >
<input type="text" class="txt " name="opening_bank" value="{$data.opening_bank}" placeholder="请输入开户行" readonly>
</td>
</tr>
<tr>
<td class="l">备注:</td>
<td class="r">
<input type="text" name="remark" class="txt" value="{$data.remark}" placeholder="请输入备注" readonly>
</td>
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>显示状态:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label>
<input type="radio" class="inp_radio" value="1" name="status" checked readonly> 开启
</label>
<label>
<input type="radio" class="inp_radio" value="0" name="status" readonly> 关闭
</label>
</span>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">文档管理</td>
<!--<td class="r table_radio">-->
<!--<input type="button" class="coin-detail" data-url="{:U('Partner/addfile')}" value="添加"-->
<!--style="border-radius:5%;background: #fff;color: #333;font-weight: 400;border: 1px solid #777;width: 100px;height: 35px">-->
<!--</td>-->
</tr>
</tbody>
</table>
<table border="1" style="width: 600px;text-align: center;margin-left:50px;" cellspacing="0" cellpadding="0" id="docShow">
</table>
</div>
<div class="form-item cf">
<!--<input class="submit_btn ajax-post" type="button" value="保存" id="submit" target-form="form-horizontal" style="margin-left:210px;">-->
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="{:U('Partner/lists')}" >
返回
</a>
</div>
</form>
</div>
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$meta_title}">
<input type="hidden" name="url" value="Partner/add">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
<script type="text/html" id="doctpl">
{@each list as it,index}
{@if index==0}
<thead>
<tr>
<th>文档名称</th>
<th>上传时间</th>
<th style="width:150px;">操作</th>
</tr>
</thead>
{@/if}
<tr>
<td style="padding:0;">${it.file_name}</td>
<td>${it.upload_time}</td>
<td>
<a class="filedown" data-index="${index}" data-path="${it.file_path}">下载</a>
<!--<a class="filedel" data-index="${index}" data-path="${it.file_path}">删除</a>-->
</td>
</tr>
{@/each}
</script>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<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 type="text/javascript">
//导航高亮
highlight_subnav("{:U('Partner/lists')}");
</script>
<script>
var doc = {$data.file_info};
if(!doc){
doc = [];
}
function addFile(info) {
doc.push(info);
layer.closeAll();
PROMOTE.juicerFun();
// window.parent.addFile(info);
}
$(".coin-detail").click(function () {
var url = $(this).data('url');
var title = '文档添加';
layer.open({
type: 2,
title: title,
shadeClose: true,
shade: 0.8,
area: ['40%', '60%'],
content: url
});
});
$("#submit").on("click",function(){
var cres = $('form').serializeArray();
//验证通过
if(doc.length > 0){
cres.push({"name":"file_info", "value":JSON.stringify(doc)});
}
console.log(cres)
//添加
$.ajax({
url:"{:U('partner/add')}",
type:"post",
data:cres,
dataType:"json",
success:function(data){
if(data.status == 1){
layer.msg(data.info,function(){
window.location.href="{:U('partner/lists')}";
});
}else{
layer.msg(data.info);
}
},
error:function(e){
}
});
})
var PROMOTE = {
juicerFun(){
var tpl =$("#doctpl").html();
var html = juicer(tpl, {list:doc});
$("#docShow").html(html);
PROMOTE.juicerEvent();
},
juicerEvent(){
$(".filedown,.filedel").off("click");
$(".filedown").on("click",function(){
var url = window.location.protocol+"//"+window.location.host+$(this).data("path");
// window.open(url,"_blank");
var link = document.createElement('a');
link.setAttribute("download", "");
link.href = url;
link.click()
});
$(".filedel").on("click",function(){
var path = $(this).data("path");
var index = $(this).data("index");
console.log(index);
var id = 0;
$.ajax({
url:"{:U('Partner/delFile')}",
type:"post",
data:{
"id":0,
"file_path":path
},
dataType:"json",
success:function(data){
if(data.status == 1){
doc.splice(index,1)
PROMOTE.juicerFun();
}else{
layer.alert(data.info);
}
},
error:function(e){
}
});
})
}
}
PROMOTE.juicerFun();
</script>
</block>

@ -566,6 +566,11 @@
}
$("#first_partner_id").select2();
$("#second_partner_id").select2();
//重置数据
DATAOBJ.first_part_company=false;
DATAOBJ.second_part_company=false;
TPLSHOW.pushStatementTypeOption();
})
})
$("#first_partner_id").on("change",function(){
@ -624,7 +629,7 @@
//CP上游公司
company_id = $("#first_partner_id").find("option:selected").val();
}else{
company_type = $("#second_partner_id").find("option:selected").val();
company_id = $("#second_partner_id").find("option:selected").val();
}
//发起查询
var selectData = {
@ -869,6 +874,10 @@
EVENT.changeStatementType();
$("#statement_type").change();//默认支付给乙方
// TPLSHOW.showPartPayInfo();//查看底下是否有值
}else{
var str = "<option value=''>请选择合作公司</option>";
$("#statement_type").html(str);
EVENT.changeStatementType();
}
},
//支付信息显示

@ -1158,8 +1158,35 @@ ADD COLUMN `company_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '工
ALTER TABLE `tab_withdraw`
ADD COLUMN `review_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '审核模式1-人工审核 2-自动审核';
--2020-02-12 liuweiwen -
ALTER TABLE tab_game ADD COLUMN `original_package_name` varchar(64) DEFAULT NULL COMMENT '游戏原包名称';
-- 2020-02-12 zyx 推广提现--新增审核模式
ALTER TABLE `tab_statement`
MODIFY COLUMN `ext_field` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '扩展字段,如果是下游为提现单号' AFTER `pay_type`;
--2020-02-12 liuweiwen -
ALTER TABLE tab_game
ADD COLUMN `original_package_name` varchar(64) DEFAULT NULL COMMENT '游戏原包名称';
--2020-02-12 liuweiwen
ALTER TABLE sys_auth_group
ADD COLUMN `show_data` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否展示权限1-是0-否';
--2020-02-12 liuweiwen
ALTER TABLE tab_partner
ADD COLUMN `matche_platform` varchar(64) DEFAULT NULL COMMENT '对应平台(简称)';
ALTER TABLE tab_partner
ADD COLUMN `contract_start_time` int(11) NOT NULL DEFAULT '0' COMMENT '合同开始时间';
ALTER TABLE tab_partner
ADD COLUMN `contract_end_time` int(11) NOT NULL DEFAULT '0' COMMENT '合同结束时间';
ALTER TABLE tab_partner
ADD COLUMN `channel_rate` decimal(2,0) NOT NULL DEFAULT '0' COMMENT '渠道费率';
ALTER TABLE tab_partner
ADD COLUMN `invoice_rate` decimal(2,0) NOT NULL DEFAULT '0' COMMENT '开票税点';
ALTER TABLE tab_partner
ADD COLUMN `is_sign_contract` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否签署合同0-未签1-已签';
ALTER TABLE tab_partner
ADD COLUMN `settlement_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '结算方式0-未知1-周结2-月结';
ALTER TABLE tab_partner
ADD COLUMN `has_game_evidence` tinyint(1) DEFAULT '0' COMMENT '是否有游戏资质0-没有1-有';
ALTER TABLE tab_partner
ADD COLUMN `remark` varchar(255) DEFAULT NULL COMMENT '备注';
ALTER TABLE tab_partner
ADD COLUMN `file_info` text COMMENT '文档信息json格式';

Loading…
Cancel
Save