Merge branch 'feature/group_type' into dev

master
zhengchanglong 5 years ago
commit 505e12beab

@ -1336,9 +1336,11 @@ function templatelist(){
*返回游戏名称
*/
function get_gamename($gid=0){
if($gid == 0){return "未知";}
$model = D("Game");
$list = $model->where("id=".$gid)->find();
// return $list;
return $list["game_name"];
}
@ -1813,4 +1815,98 @@ function getAdmin($column = 'uid') {
return session("user_auth")[$column];
}
//获取所有有关的公司
function getCompanyList() {
$sql = "select id,company_name,1 as company_type from tab_promote_company UNION ALL select id,partner,0 as company_type from tab_partner";
$data = M()->table("({$sql}) as a")->select();
return $data;
}
function excelUpStreamTemplate() {
header("Content-type: text/html; charset=gb2312");
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
date_default_timezone_set('Europe/London');
Vendor("PHPExcel.PHPExcel");
$objPHPExcel = new \PHPExcel();
$objReader = \PHPExcel_IOFactory::createReader('Excel5');
//设置模板文件
$objPHPExcel = $objReader->load("Runtime/upstream.xls");
$objPHPExcel->getActiveSheet()->setCellValue('D2', 'chengzhi');
$objPHPExcel->getActiveSheet()->insertNewRowBefore(10,1)->mergeCells('J10:K10')->insertNewRowBefore(10,1)->mergeCells('J10:K10');
ob_end_clean();//清除缓冲区,避免乱码
header('pragma:public');
header('Content-type:application/vnd.ms-excel;charset=utf-8;name="15415.xls"');
header("Content-Disposition:attachment;filename=15415.xls");//attachment新窗口打印inline本窗口打印
$objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');
exit;
}
function excelDownStreamTemplate() {
header("Content-type: text/html; charset=gb2312");
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
date_default_timezone_set('Europe/London');
Vendor("PHPExcel.PHPExcel");
$objPHPExcel = new \PHPExcel();
$objReader = \PHPExcel_IOFactory::createReader('Excel5');
//设置模板文件
$objPHPExcel = $objReader->load("upstream.xls");
$objPHPExcel->getActiveSheet()->setCellValue('D2', 'chengzhi');
$objPHPExcel->getActiveSheet()->insertNewRowBefore(10,1);
ob_end_clean();//清除缓冲区,避免乱码
header('pragma:public');
header('Content-type:application/vnd.ms-excel;charset=utf-8;name="15415.xls"');
header("Content-Disposition:attachment;filename=15415.xls");//attachment新窗口打印inline本窗口打印
$objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');
exit;
}
function getWithdrawNumber() {
$map = [];
$map['ext_field'] = ['neq',null];
$data = M('withdraw',"tab_")
->field("widthdraw_number")
->join("left join tab_statement as statement on tab_withdraw.widthdraw_number = statement.ext_field")
->where("ext_field is null")
->select();
return $data;
}
?>

@ -8054,4 +8054,69 @@ class ExportController extends Controller
exit();
}
public function excelUpStreamTemplate() {
header("Content-type: text/html; charset=gb2312");
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
date_default_timezone_set('Europe/London');
Vendor("PHPExcel.PHPExcel");
$objPHPExcel = new \PHPExcel();
$objReader = \PHPExcel_IOFactory::createReader('Excel5');
//设置模板文件
$objPHPExcel = $objReader->load("Runtime/upstream.xls");
$objPHPExcel->getActiveSheet()->setCellValue('D2', 'chengzhi');
$objPHPExcel->getActiveSheet()->insertNewRowBefore(10,1)->mergeCells('J10:K10')->insertNewRowBefore(10,1)->mergeCells('J10:K10');
ob_end_clean();//清除缓冲区,避免乱码
header('pragma:public');
header('Content-type:application/vnd.ms-excel;charset=utf-8;name="15415.xls"');
header("Content-Disposition:attachment;filename=15415.xls");//attachment新窗口打印inline本窗口打印
$objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');
exit;
}
public function excelDownStreamTemplate() {
header("Content-type: text/html; charset=gb2312");
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
date_default_timezone_set('Europe/London');
Vendor("PHPExcel.PHPExcel");
$objPHPExcel = new \PHPExcel();
$objReader = \PHPExcel_IOFactory::createReader('Excel5');
//设置模板文件
$objPHPExcel = $objReader->load("upstream.xls");
$objPHPExcel->getActiveSheet()->setCellValue('D2', 'chengzhi');
$objPHPExcel->getActiveSheet()->insertNewRowBefore(10,1);
ob_end_clean();//清除缓冲区,避免乱码
header('pragma:public');
header('Content-type:application/vnd.ms-excel;charset=utf-8;name="15415.xls"');
header("Content-Disposition:attachment;filename=15415.xls");//attachment新窗口打印inline本窗口打印
$objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');
exit;
}
}

@ -405,12 +405,14 @@ class GameController extends ThinkController
$data['introduction'] = str_replace("~~", "\r\n", $data['introduction']);
$this->assign('data', $data);
$this->assign('game_id', $id);
$game_ratio = M('cp_game_ratio', 'tab_')->where(array('is_del'=>"0","game_id"=>$id))->order('begin_total_amount asc')->select();
$this->meta_title = '编辑游戏';
$this->m_title = '游戏列表';
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Game/lists', 'status' => 1])->find());
$this->assign('game_ratio',$game_ratio);
$this->display();
}
}
@ -761,4 +763,80 @@ class GameController extends ThinkController
}
/**
* 编辑CP分成比例
*/
public function edit_ratio(){
$data = $_POST;
if($data['data_id']==0 || $data['data_id']==""){ //查询初始分成比例信息
$initial_info = M('cp_game_ratio', 'tab_')->where("game_id=%d and begin_total_amount=0 and is_del=0",$data['game_id'])->find();
}
if($data['data_type']=='initial'){ //CP初始分成比例
if($data['data_id']>0){ //修改初始CP分成比例
$where = array();
$where['is_del'] = "0";
$where['game_id'] = $data['game_id'];
$where['id'] = array("neq",$data['data_id']);
$where['ratio'] = array("elt",$data['game_ratio']);
$info = M('cp_game_ratio', 'tab_')
->where($where)
->order("ratio asc")
->find();
if($info){
die(json_encode(array("result"=>"0","desc"=>"CP分成比例应小于".$info['ratio']."%")));
}
M('cp_game_ratio', 'tab_')->where("id=%d",$data['data_id'])->data(array("ratio"=>$data['game_ratio'],"update_time"=>time()))->save();
}else{
if($initial_info){
M('cp_game_ratio', 'tab_')->where("id=%d",$initial_info['id'])->data(array("ratio"=>$data['game_ratio'],"update_time"=>time()))->save();
}else{
M('cp_game_ratio', 'tab_')->data(array("game_id"=>$data['game_id'],"ratio"=>$data['game_ratio'],"begin_total_amount"=>0,"add_time"=>time(),"update_time"=>time()))->add();
}
}
}else{ //CP阶梯分成档位
if($data['data_id']>0) { //修改阶梯分成
$where = array();
$where['game_id']= $data['game_id'];
$where['is_del'] = "0";
$where['id']=array("neq",$data['data_id']);
$exis_info = M('cp_game_ratio', 'tab_')
->where($where)
->where("begin_total_amount='%s' or ratio = '%f'",array($data['total_amount'],$data['game_ratio']))
->find();
if($exis_info){
die(json_encode(array("result"=>"0","desc"=>"分成档位已存在")));
}
if($initial_info['game_ratio']>=$data['game_ratio']){
die(json_encode(array("result"=>"0","desc"=>"分成比例不得小于初始比例")));
}
M('cp_game_ratio', 'tab_')->where("id=%d",$data['data_id'])->data(array("ratio"=>$data['game_ratio'],"begin_total_amount"=>$data['total_amount'],"update_time"=>time()))->save();
}else{
if(!$initial_info){
die(json_encode(array("result"=>"0","desc"=>"请先设置初始CP分成比例")));
}
$exis_info = M('cp_game_ratio', 'tab_')->where("game_id=%d and (begin_total_amount='%s' or ratio = '%f') and is_del=0",array($data['game_id'],$data['total_amount'],$data['game_ratio']))->find();
if($exis_info){
die(json_encode(array("result"=>"0","desc"=>"分成档位已存在")));
}else{
$max_info = M('cp_game_ratio', 'tab_')->field("max(ratio) as max_ratio,max(begin_total_amount) as max_amount")->where("game_id=%d and is_del=0",$data['game_id'])->find();
if($max_info['max_ratio'] >= $data['game_ratio'] || $max_info['max_amount']>=$data['total_amount']){
die(json_encode(array("result"=>"0","desc"=>"新增分成档位金额或分成比例需大于现有分成档位")));
}
M('cp_game_ratio', 'tab_')->data(array("game_id"=>$data['game_id'],"ratio"=>$data['game_ratio'],"begin_total_amount"=>$data['total_amount'],"add_time"=>time(),"update_time"=>time()))->add();
}
}
}
echo(json_encode(array("result"=>"1","desc"=>"数据保存成功")));
}
/**
* 删除CP分成比例
*/
public function delete_ratio(){
M('cp_game_ratio', 'tab_')->where("id=".$_POST['data_id'])->data(array("is_del"=>"1","update_time"=>time()))->save();
echo(json_encode(array("result"=>"1","desc"=>"删除成功")));
}
}

@ -1445,30 +1445,36 @@ class QueryController extends ThinkController
//关联表获取会长账号名
$data = M()->table('('.$data.') as a')
->field("my_time,pay_amount,a.game_id,game_name,game_names,a.promote_id,a.promote_account,a.company_relation,a.company_belong,CASE WHEN root_id is null THEN 0 ELSE root_id END as root_id,CASE WHEN account is null THEN '官方渠道' ELSE account END as account,ratio,turnover_ratio")
->field("my_time,pay_amount,a.game_id,game_name,game_names,a.promote_id,a.promote_account,a.company_relation,a.company_belong,CASE WHEN root_id is null THEN 0 ELSE root_id END as root_id,CASE WHEN account is null THEN '官方渠道' ELSE account END as account,tab_ratio.ratio as ratio,turnover_ratio,game_ratio.ratio as games_ratio")
->join("left join tab_promote on root_id = tab_promote.id")
->join("left join tab_promote_game_ratio as tab_ratio on tab_ratio.game_id = a.game_id and tab_ratio.promote_id=root_id")
->join("left join tab_cp_game_ratio as game_ratio on game_ratio.game_id = a.game_id")
->page($page,$row)
->where($map)
->group("my_time,game_names,root_id")
->order("my_time Desc")
->select();
// dump($data);die();
$pagecount = M()->table('('.$count.') as a')->count();
foreach($data as $key => $value) {
$data[$key]['upstream'] = $value['pay_amount'] * 0.2;
if ($value['games_ratio']) {
$data[$key]['upstream'] = $value['pay_amount'] * ($value['games_ratio']*0.01);
} else {
$data[$key]['upstream'] = $value['pay_amount'] * 0;
}
if ($value['ratio']) {
$data[$key]['downstream'] = $value['pay_amount'] * ($value['ratio']*0.01);
} else {
$data[$key]['downstream'] = $value['pay_amount'] * 0.1;
$data[$key]['downstream'] = $value['pay_amount'] * 0;
}
$value['turnover_ratio'] = json_decode($value['turnover_ratio'],true);
// array_push($value['turnover_ratio'],['turnover'=>1006,'ratio'=>30]);
// dump(json_encode($value['turnover_ratio']));die();
if (is_array($value['turnover_ratio'])) {
foreach($value['turnover_ratio'] as $k =>$v) {

@ -0,0 +1,54 @@
<?php
namespace Admin\Controller;
use User\Api\UserApi as UserApi;
/**
* 推广查询控制器
* @author 王贺
*/
class StatementMangementController extends ThinkController
{
public function lists() {
$map = [];
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
$map['create_time'] = ['between', [strtotime(I('time_start')), strtotime(I('time_end')) + 86399]];
} elseif (isset($_REQUEST['time_start'])) {
$map['create_time'] = ['GT', strtotime(I('time_start'))];
} elseif (isset($_REQUEST['time_end'])) {
$map['create_time'] = ['LT', strtotime(I('time_end')) + 86399];
}
if ($_REQUEST['statement_type']) {
$map['statement_type'] = $_REQUEST['statement_type'];
}
if ($_REQUEST['company_id']) {
$map['company_name'] = $_REQUEST['company_id'];
}
$data = M("statement","tab_")
->where($map)
->select();
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]['is_confirm'] = $data[$key]['is_confirm']?'确认':'未确认';
$data[$key]['statement_type'] = $value['statement_type']?'公会对账单':'CP对账单';
}
$this->assign('data',$data);
$this->display();
}
}

@ -639,6 +639,17 @@ class ToolController extends ThinkController {
$this->display();
}
/**
*公司信息管理
*/
public function company_info()
{
$str = "company_info";
$this->BaseConfig($str);
$this->meta_title = '公司信息管理';
$this->display();
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,479 @@
<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__/layer3/layer.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}
.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;}
.data_list table tbody tr a.disabled,.data_list table tbody tr a.disabled:hover {color:#999;cursor:default;}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">市场结算管理</h3>
<p class="description_text">说明:绩优流水计算管理</p>
</div>
<div class="cf top_nav_list" style="height: 38px;">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list" style="margin-bottom: 0">
<div class="input-list input-list-promote search_label_rehab">
<select id="statement_type" name="statement_type" class="select_gallery" style="width:150px;">
<option value="">对账类型</option>
<option value="1">公会对账单</option>
<option value="0">CP对账单</option>
</select>
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="company_id" name="company_id" class="select_gallery" >
<option company-type="" value="">请选择或输入对账公司</option>
<volist name=":getCompanyList()" id="vo">
<option company-type="{$vo.company_type}" value="{$vo.company_name}" <?php echo $vo.company_name == I('company_name') ? 'selected':''; ?> >{$vo.company_name}</option>
</volist>
</select>
</div>
<div class="input-list">
<input type="text" readonly id="time_start" name="time_start" class="" value="{:I('time_start')}" placeholder="开始时间" />
&nbsp;-&nbsp;
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" readonly id="time_end" name="time_end" class="" value="{:I('time_end')}" placeholder="结束时间" />
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<input type="hidden" name="" value="" class="sortBy">
<input type="hidden" name="type" value="{$_GET['type']}">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('StatementMangement/lists','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
</div>
</div>
</div>
<div class="butnbox" >
<div class="butnlist jscheckbutn" style="margin-left: 2px">
<a class="butn" id="upstream">生成上游对账单</a>
<a class="butn" id="downstream">生成下游对账单</a>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<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>
</if>
<notemtpy name = "data">
<volist name="data" id="data">
<tr>
<td>{$data.statement_type}</td>
<td>{$data.create_time}</td>
<td>{$data.company_name}</td>
<td>{$data.statement_begin_time}-{$data.statement_end_time}</td>
<td>{$data.statement_money}</td>
<td>{$data.is_confirm}</td>
<td><a class="confirm " href="{:U('Member/del?id='.$data['id'])}">撤销</a>
<a class="confirm " id="statement_edit" edit-id="{$data.id}">编辑</a></td>
</tr>
</volist>
</notemtpy>
</tbody>
</table>
</div>
</div>
<div class="page">
<if condition="$is_admin eq true ">
<a class="sch-btn" href="{:U('Export/promote_list',array_merge(['xlsname'=>'推广员管理_推广员列表'.((I('type',1)==2)?'_混服申请':'_推广员列表')],I('get.')))}">导出</a>
</if>
{$_page|default=''}
</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="{$m_title}">
<input type="hidden" name="url" value="Promote/lists/type/{:I('type',1)}">
</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>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '
<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">
';
</php>
<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 src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript">
</script>
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('Query/marketList')}');
$(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;
}
}
$("#upstream").click(function () {
layer.open({
type: 2,
title: "【游戏角色】列表",
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
content: ['/admin.php?s=/Member/role_list/' , 'no']
});
});
$("#downstream").click(function () {
layer.open({
type: 2,
title: "【游戏角色】列表",
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
content: ['/admin.php?s=/Member/role_list/' , 'no']
});
});
$("#statement_edit").click(function () {
var id = $(this).attr('edit-id');
console.log(id)
layer.open({
type: 2,
title: "【游戏角色】列表",
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
content: ['/admin.php?s=/Member/role_list/' , 'no']
});
});
$("#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;
});
$('#time_start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left'
})
$("#company_id").change(function(){
var str = '<option value="">对账类型</option>';
console.log($("#company_id option:selected").attr('company-type'))
if ($("#company_id option:selected").attr('company-type') == '1') {
str += ' <option value="1" selected=selected>公会对账单</option>\n' +
' <option value="0">CP对账单</option>';
} else if ($("#company_id option:selected").attr('company-type') == '0') {
str += ' <option value="1">公会对账单</option>\n' +
' <option value="0" selected=selected>CP对账单</option>';
}
$("#statement_type").empty();
$("#statement_type").append(str);
$("#statement_type").select2();
});
$(".paixu").click(function(){
var that=$(this);
$data_order=that.attr('data-order');
$order_type='{$userarpu_order}';
if($order_type==''||$order_type=='4'){
$(".sortBy").attr('name','data_order');
val='3,'+$data_order;
$(".sortBy").attr('value',val);
$("#search").click();
}else if($order_type=='3'){
$(".sortBy").attr('name','data_order');
val='4,'+$data_order;
$(".sortBy").attr('value',val);
$("#search").click();
}
});
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
$("#admin").on('click',function(event) {
var navlist = $(this).find('.i_list_li');
if (navlist.hasClass('hidden')) {
navlist.removeClass('hidden');
$(this).find('#i_list_id').focus().val('');
} else {
navlist.addClass('hidden');
}
$(document).one("click", function(){
navlist.addClass('hidden');
});
event.stopPropagation();
});
$('#admin #i_list_id').on('keyup',function(event) {
var val = $.trim($(this).val()).toLowerCase();
$(this).closest('.drop-down').find('#i_list_idh').val(val);
});
$("#admin #i_list_li").find("a").each(function(){
$(this).click(function(){
var text = $.trim($(this).text()).toLowerCase();
$(this).closest('.drop-down').find("#i_list_id").val(text);
$(this).closest('.drop-down').find('#i_list_idh').val(text);
})
});
//下拉内容框
$(".drop-down2").on('click',function(event) {
var navlist = $(this).find('.i_list_li');
if (navlist.hasClass('hidden')) {
navlist.removeClass('hidden');
$('#i_list_id').focus().val('');
} else {
navlist.addClass('hidden');
}
$(document).one("click", function(){
navlist.addClass('hidden');
});
event.stopPropagation();
});
/* 状态搜索子菜单 */
/*渠道删除*/
$('.delete').click(function(){
var id = $(this).attr('data-id');
layer.confirm('渠道删除后,下级渠道同时被删除,所属数据归属于自然渠道!', {
title:'确定要删除该渠道?',
icon:0,
btn: ['删除','取消'] //按钮
}, function(){
$.ajax({
type: "POST",
url: "{:U('del_promote')}",
dataType: 'json',
async: false,
data: {id:id},
success:function(data){
if(data.status==1){
layer.msg(data.msg);
setTimeout(function(){
window.location.reload();
},1500);
}
}
});
}, function(){
layer.close();
});
})
})
</script>
<script type="text/javascript">
//点击字母按照条件按钮筛选
$(".pro_promot_select_list_con").click(function(){
//选中高亮样式
$(this).addClass('active');
$(this).siblings().removeClass('active');
var that = $(this);
var index = $(this).attr("data-index");
$("#game_list li").each(function(index,ele){
var short = $(this).attr('data-short');
$(this).show();
if(that.attr('data-index')){
if(that.attr('data-index')!=short.charAt(0)){
$(this).hide();
}
}
})
});
//打开弹窗
$(".ajax-view").click(function(){
//获取游戏列表
var url = "{:U('Promote/getPromoteGame')}";
var id = $(this).attr('data-id');
$.post(url,{id:id},function(res){
if(res.code==1){
$(".pro_promot_select_list a").eq(0).addClass('active');
$(".pro_promot_select_list a").eq(0).siblings().removeClass('active');
var game_list = res.data.game_list;
var promote_info = res.data.promote_info;
var lis = [];
$.each(game_list,function(index,ele){
if(ele.game_name.length>6){
ele.game_name = ele.game_name .substring(0,6)+"..."
}
lis.push('<li class="fl pro_promot_game_con" data-short="'+ele.short+'">');
if(promote_info['game_ids']==''){
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
}else{
if(promote_info['game_ids'].indexOf(ele.id)>-1){
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
}else{
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" id="gameCheck'+index+'" />');
}
}
lis.push('<label for="gameCheck'+index+'" class="fl"></label>');
lis.push('<span class="fl pro_promot_game_name">'+ele.game_name+'</span>');
lis.push('</li>');
});
$("#game_list").html(lis.join(''));
$(".pro_promot_number").text(res.data.promote_info.account);
$("#se_promote_id").val(res.data.promote_info.id);
$(".pro_promot").css("display","block");
jsgameid();
}else{
var tip_msg = res.info ? res.info : '操作失败';
layer.msg(tip_msg);
}
});
});
//保存修改
$(".pro_promot_btn_confirm").click(function(){
$("#ajaxForm").ajaxSubmit(function(res){
layer.msg(res.msg);
$(".pro_promot").hide();
});
return false;
});
//关闭弹窗
$(".pro_promot_close").click(function(){
$(".pro_promot").css("display","none");
});
//取消修改
$(".pro_promot_btn_cancel").click(function(){
$(".pro_promot").css("display","none");
layer.msg('修改已取消');
});
$(".jsgamecheckall").click(function(){
$(this).closest('.jsgamecheckallbox').siblings("#game_list").find(".jsgameid").prop("checked", this.checked);
});
//可申请游戏 全选及全选反选 功能 @author zwm date 20180604
function jsgameid(){
$(".jsgameid").click(function(){
var option = $(this).closest('ul').find(".jsgameid"),
checkall = $(this).closest('ul').siblings('.jsgamecheckallbox').find('.jsgamecheckall');
option.each(function(i){
if(!this.checked){
checkall.prop("checked", false);
return false;
}else{
checkall.prop("checked", true);
}
});
});
}
</script>
</block>

@ -0,0 +1,134 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
<p class="description_text">公司对外展示信息管理</p>
</div>
<div class="tab-wrap">
<div class="tab-content tabcon1711 tabcon17112">
<div id="tab1" class="tab-pane in tab1">
<div class="tab-content-subpan jssubpan clearfix current">
<form action="{:U('saveTool')}" method="post" class="form-horizontal company_info form_info_ml">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l noticeinfo">公司名称</td>
<td class="r table_radio">
<input name="config[name]" type="text" value="{$company_info['name']}" class="">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">联系人</td>
<td class="r table_radio">
<input name="config[link_name]" type="text" value="{$company_info['link_name']}" class="">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">联系电话</td>
<td class="r table_radio">
<input name="config[link_phone]" type="text" value="{$company_info['link_phone']}" class="">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">邮寄地址</td>
<td class="r table_radio">
<input name="config[address]" type="text" value="{$company_info['address']}" class="">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">公司税号</td>
<td class="r table_radio">
<input name="config[company_tax_no]" type="text" value="{$company_info['company_tax_no']}" class="">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">收款方名称</td>
<td class="r table_radio">
<input name="config[payee_name]" type="text" value="{$company_info['payee_name']}" class="">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">银行账号</td>
<td class="r table_radio">
<input name="config[bank_account]" type="text" value="{$company_info['bank_account']}" class="">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">开户行</td>
<td class="r table_radio">
<input name="config[opening_bank]" type="text" value="{$company_info['opening_bank']}" class="">
<span class="notice-text"></span>
</td>
</tr>
</tbody>
</table>
<input type="hidden" name="name" value="company_info">
<input type="submit" id="submit" value="确定" target-form="company_info" class="submit_btn form_btn ajax-post mlspacing">
</form>
</div>
</div>
</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="{$m_title}">
<input type="hidden" name="url" value="{$m_url}">
</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>
</block>
<block name="script">
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('Tool/company_info')}');
Think.setValue('status','{$company_info_data.status|default=0}');
$(function(){
//支持tab
showTab();
})
</script>
</block>
Loading…
Cancel
Save