master
chenzhi 5 years ago
commit cda9d0c1a8

@ -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"];
}
@ -1826,4 +1828,85 @@ function getCompanyList() {
}
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;
}
?>

@ -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"=>"删除成功")));
}
}

@ -138,7 +138,7 @@ class MemberController extends ThinkController
//计算用户列表
$data = M("user","tab_")
->field("tab_user.id,`device_number`,`age_status`,`account`,`balance`,`gold_coin`,`alipay`,tab_user.promote_id,`register_type`,tab_user.promote_account,`register_time`,`lock_status`,`register_way`,`register_ip`,`login_time`,`check_status`,IFNULL(sum(ss.pay_amount), 0) AS recharge_total")
->field("tab_user.id,`device_number`,`age_status`,`account`,`balance`,`gold_coin`,`alipay`,tab_user.promote_id,`register_type`,tab_user.promote_account,`register_time`,`lock_status`,lock_remark,`register_way`,`register_ip`,`login_time`,`check_status`,IFNULL(sum(ss.pay_amount), 0) AS recharge_total")
->where($map)
->group("tab_user.id")
// ->page($page, $row)
@ -1230,7 +1230,12 @@ class MemberController extends ThinkController
if ($accounts) $map['account'] = ['in', array_unique(explode("\n", $accounts))];
if ($id) $map['id'] = ['in', array_unique(explode("\n", $id))];
$users = M('user', 'tab_')->where($map)->field('id')->select();
$res = M('user', 'tab_')->where($map)->setField(['lock_status' => $lock_status]);
if($_POST['lock_remark']){
$res = M('user', 'tab_')->where($map)->setField(['lock_status' => $lock_status,"lock_remark" => $_POST['lock_remark']]);
}else{
$res = M('user', 'tab_')->where($map)->setField(['lock_status' => $lock_status]);
}
if ($res) {
foreach ($users as $item) {
\Think\Log::actionLog('Member/lock_status', 'Member', $item['id']);

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

@ -13,7 +13,7 @@
<div class="tab-content tabcon1711">
<!-- 表单 -->
<form id="form" action="{:U('edit?model='.$model['id'])}" method="post" class="form-horizontal">
<form id="form" action="{:U('edit?id='.$model['id'])}" method="post" class="form-horizontal">
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">基本信息</h3>
<p class="description_text">说明:此处显示本站玩家账号的相关信息</p>
@ -55,16 +55,19 @@
<tr>
<td class="l noticeinfo">账号状态</td>
<td class="r table_radio">
<span class="form_radio table_btn player_table_btn">
<label>
<input type="radio" value="1" name="lock_status"
<eq name="data['lock_status']" value="1">checked="checked"</eq>> 开启
</label>
<label>
<input type="radio" value="0" name="lock_status"
<eq name="data['lock_status']" value="0">checked="checked"</eq>> {:L('Lock')}
</label>
</span>
<span class="form_radio table_btn player_table_btn">
<label>
<if condition="get_info_status($data['lock_status'],4) eq 锁定">
已锁定&nbsp;
<a class="ajax-get" href="{:U('Member/lock_status',array('id'=>$data['id'],'lock_status'=>1))}">启用 </a>
<input type="hidden" name="lock_status" value="0">
<else />
正常&nbsp;
<a href="javascript:void();" id="lock" data-url="{:U('Member/lock_status',array('id'=>$data['id'],'lock_status'=>0))}">{:L('Lock')}</a>
<input type="hidden" name="lock_status" value="1">
</if>
</label>
</span>
<span class="notice-text">可设置玩家账号的登录状态,锁定即无法登录本平台</span>
</td>
</tr>
@ -475,4 +478,32 @@
});
});
</script>
<script>
$("#lock").bind("click",function () {
var url = $(this).attr("data-url");
layer.prompt({
formType: 3,
title: "请备注锁定原因",
value: ''
}, function (remark,index) {
$.ajax({
cache: true,
type: "POST",
url: url,
data:{
lock_remark:remark
},
async: false,
error: function(data) {
layer.alert("服务器故障,请稍后重试!",{icon: 2});
},
success: function(data) {
location.reload()
}
});
layer.close(index);
});
})
</script>
</block>

@ -211,12 +211,12 @@
<th>
金币
</th>
<th>
绑定支付宝
</th>
<th>
小号
</th>
<!-- <th>
绑定支付宝
</th>
<th>
小号
</th>-->
<th>
VIP等级
</th>
@ -227,6 +227,7 @@
<th >注册IP</th>
<th >最后登录时间</th>
<th >设备号</th>
<th >锁定备注</th>
<th >账号状态</th>
<th >拉黑状态</th>
<th >操作</th>
@ -275,13 +276,13 @@
<td >{$data.balance}</td>
<td >{$data.recharge_total}</td>
<td >{$data.gold_coin|default='0.00'}</td>
<td >{$data.alipay|default='--'}</td>
<!--<td >{$data.alipay|default='&#45;&#45;'}</td>
<td >
<gt name="data.small_count" value="0">
<a class="jssamlllist" data-url="{:U('Member/small_list',array('id'=>$data['id'],'account'=>$data['account']))}" data-account="{$data.account}" href="javascript:;">{$data.small_count|default=0}</a>
<else />--
<else />&#45;&#45;
</gt>
</td>
</td>-->
<td>{:get_vip_level($data['recharge_total'])}</td>
<if condition="I('type') eq 1 or I('type') eq ''">
<td >
@ -309,6 +310,9 @@
{$data.device_number|encryptStr}
</if>
</td>
<td >
{$data.lock_remark}
</td>
<if condition="get_info_status($data['lock_status'],4) eq 锁定">
<td style="color:red;">已{:get_info_status($data['lock_status'],4)}</td>
<else />
@ -321,8 +325,11 @@
</eq>
<td >
<a href="{:U('Member/edit?id='.$data['id'])}">查看 </a>
<a class="ajax-get" href="{:U('Member/lock_status',array('id'=>$data['id'],'lock_status'=>1))}">启用 </a>
<a class="ajax-get" href="{:U('Member/lock_status',array('id'=>$data['id'],'lock_status'=>0))}">{:L('Lock')}</a>
<if condition="get_info_status($data['lock_status'],4) eq 锁定">
<a class="ajax-get" href="{:U('Member/lock_status',array('id'=>$data['id'],'lock_status'=>1))}">启用 </a>
<else />
<a href="javascript:;" id="lock" data-url="{:U('Member/lock_status',array('id'=>$data['id'],'lock_status'=>0))}">{:L('Lock')}</a>
</if>
</td>
</tr>
</volist>
@ -355,7 +362,7 @@
<div class="page">
<if condition="$is_admin eq true ">
<a class="sch-btn export-btn"
href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a>
href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a>
<!-- <a class="sch-btn" href="{:U('Export/expUser',array_merge(['id'=>3,'xlsname'=>'玩家_玩家列表_'.(I('get.type')==2?'第三方玩家':'本站玩家')],I('get.')))}">导出</a> -->
</if>
{$_page|default=''}
@ -582,4 +589,31 @@
}
</script>
<script>
$(document).on('click', '#lock', function(){
var url = $(this).attr("data-url");
layer.prompt({
formType: 3,
title: "请备注锁定原因",
value: ''
}, function (remark,index) {
$.ajax({
cache: true,
type: "POST",
url: url,
data:{
lock_remark:remark
},
async: false,
error: function(data) {
layer.alert("服务器故障,请稍后重试!",{icon: 2});
},
success: function(data) {
location.reload()
}
});
layer.close(index);
});
})
</script>
</block>

@ -37,14 +37,14 @@
</tr>
<tr>
<td class="l">联系人:</td>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>联系人:</td>
<td class="r" >
<input type="text" class="txt " name="link_man" value="" placeholder="请输入联系人">
</td>
</tr>
<tr>
<td class="l">联系电话:</td>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>联系电话:</td>
<td class="r" >
<input type="text" class="txt " name="link_phone" value="" placeholder="请输入联系电话">
</td>

@ -37,14 +37,14 @@
</tr>
<tr>
<td class="l">联系人:</td>
<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="请输入联系人">
</td>
</tr>
<tr>
<td class="l">联系电话:</td>
<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="请输入联系电话">
</td>

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

@ -970,4 +970,18 @@ CREATE TABLE `tab_statement` (
KEY `link_phone` (`link_phone`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='cp/公会对账单';
-- 新增CP游戏分成比例表 2020-01-09 郑昌隆
CREATE TABLE `tab_cp_game_ratio` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`game_id` int(11) DEFAULT '0' COMMENT '游戏ID',
`ratio` decimal(5,2) DEFAULT '0.00' COMMENT '分成比率',
`begin_total_amount` decimal(11,2) DEFAULT '0.00' COMMENT '分成开始档位总流水',
`add_time` int(11) DEFAULT '0' COMMENT '添加时间',
`update_time` int(11) DEFAULT '0' COMMENT '更新时间',
`is_del` tinyint(2) DEFAULT '0' COMMENT '1-已删除',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- 玩家列表账户锁定添加备注 2020-01-09 郑昌隆
ALTER TABLE `tab_user` ADD COLUMN `lock_remark` varchar(512) NOT NULL DEFAULT '' COMMENT '账号锁定原因' after lock_status;

Loading…
Cancel
Save