Merge branch 'release' of 8.136.139.249:wmtx/platform into feature/add_item

master
zhengyongxing 4 years ago
commit 8a49578cc4

@ -14,6 +14,8 @@ use Base\Task\Task;
use Base\Service\MarketService;
use Base\Tool\AggregateClient;
use Base\Repository\GameRepository;
use Base\Tool\Redis;
use Think\Model;
class ConsoleController extends Think {
@ -666,4 +668,84 @@ class ConsoleController extends Think {
}
echo '<table>' . PHP_EOL . $trs . '</table>';
}
public function generateHistoryGame()
{
$items = M('spend', 'tab_')
->field(['tab_promote.level1_id', 'group_concat(distinct tab_spend.game_id) game_ids'])
->join('left join tab_promote on tab_spend.promote_id=tab_promote.id')
->where('tab_spend.is_check=1 and tab_spend.pay_status=1')
->group('tab_promote.level1_id')
->select();
foreach ($items as $item) {
if ($item['level1_id']) {
$key = Redis::getKey('promote_history_games', ['promote_id' => $item['level1_id']]);
Redis::set($key, $item['game_ids']);
}
}
}
public function updateHistoryGame()
{
$items = M('spend', 'tab_')
->field(['tab_promote.level1_id', 'group_concat(distinct tab_spend.game_id) game_ids'])
->join('left join tab_promote on tab_spend.promote_id=tab_promote.id')
->where('tab_spend.is_check=1 and tab_spend.pay_status=1 and tab_spend.pay_time>' . strtotime(date('Y-m-d 00:00:00')))
->group('tab_promote.level1_id')
->select();
foreach ($items as $item) {
if ($item['level1_id']) {
$key = Redis::getKey('promote_history_games', ['promote_id' => $item['level1_id']]);
$value = Redis::get($key);
$gameIds = $value ? explode(',', $value) : [];
$nowGameIds = explode(',', $item['game_ids']);
$gameIds = array_unique(array_merge($gameIds, $nowGameIds));
Redis::set($key, implode(',', $gameIds));
}
}
}
public function generatePromotesLevelId()
{
$promotes = M('promote', 'tab_')->field(['chain', 'id'])->select();
foreach ($promotes as $promote) {
$fullChain = explode('/', $promote['chain'] . $promote['id']);
M('promote', 'tab_')->where(['id' => $promote['id']])->save([
'level1_id' => $fullChain[1] ?? 0,
'level2_id' => $fullChain[2] ?? 0,
'level3_id' => $fullChain[3] ?? 0,
'level4_id' => $fullChain[4] ?? 0,
]);
}
}
public function setUserFirstPayTime()
{
$hasNext = true;
$limit = 500;
$lastId = 0;
do {
$items = M('spend', 'tab_')
->field(['user_id', 'min(pay_time) first_pay_time'])
->where(['pay_status' => 1, 'user_id' => ['gt', $lastId]])
->group('user_id')
->order('user_id asc')
->limit($limit)
->select();
$model = new Model();
$model->startTrans();
foreach ($items as $item) {
M('user', 'tab_')->where(['id' => $item['user_id']])->save([
'first_pay_time' => $item['first_pay_time']
]);
$lastId = $item['user_id'];
}
$model->commit();
if (count($items) < $limit) {
$hasNext = false;
}
} while($hasNext);
}
}

@ -15,7 +15,6 @@ class SocietyInfoController extends ThinkController
private $modelName = 'SocietyInfo';
private $admininfo = '';
private $level = [
0=>'无',
1=>'S',
2=>'A',
3=>'B',
@ -73,12 +72,12 @@ class SocietyInfoController extends ThinkController
}
if (I('sociaty_level') && I('sociaty_level') != '0') $map['sociaty_level'] = I('sociaty_level');
//获取分页数据
$query = $model->where($map)->order("id desc");
$query = $model->where($map)->order("communication_time desc");
$count = $query->count();
if($is_export){
$parseData = $query->field("province, city, company_name, register_capital, functionary, phone, wechat, qq, game_type, game_name, join_platform, promote_scale,sociaty_level, turnover, address, league_info, is_potential, remark, interface_person, create_time, communication_time, create_account")
->where($map)
->order("id desc")
->order("communication_time desc")
->select();
foreach ($parseData as &$v) {
$v['sociaty_level'] = $this->level[$v['sociaty_level']];
@ -96,7 +95,7 @@ class SocietyInfoController extends ThinkController
$this->export($head, $parseData, "公会信息-".date('Ymd'));
return ;
} else {
$societyInfos = $model->where($map)->order("id desc")->field("*")->page($page,$row)->select();
$societyInfos = $model->where($map)->order("communication_time desc")->field("*")->page($page,$row)->select();
// dump($societyInfos);die();
}
@ -118,6 +117,10 @@ class SocietyInfoController extends ThinkController
&& $v['is_potential'] == 1
)
$v['is_gap_time'] = 1;
if($gap == 0 && $v['communication_time']!=$v['create_time']) {
$v['is_gap_time'] = 0;
}
}
$this->checkListOrCountAuthRestMap($map,[]);
@ -585,7 +588,12 @@ class SocietyInfoController extends ThinkController
if (strlen($inserts[$k-2]['league_info']) > 100) {
$this->ajaxReturn(['msg'=>"联盟信息太长".$k,"status"=>0]);
}
$inserts[$k-2]['is_potential'] = $v['Q']=="是" ? 1 : 0;
if ($v['Q']) {
$inserts[$k-2]['is_potential'] = ($v['Q']=="是" ? 1 : 0);
} else {
$inserts[$k-2]['is_potential'] = 1;
}
$inserts[$k-2]['remark'] = $v['R'] ?? '';
if (strlen($inserts[$k-2]['remark']) > 100) {
$this->ajaxReturn(['msg'=>"备注太长".$k,"status"=>0]);

@ -243,6 +243,121 @@ class TestingResourceController extends ThinkController
$this->assign('records', $records);
$this->display();
}
public function dailyCountTip()
{
$tipApply = 10000;
$params = [
'create_time_start'=>date("Y-m-d",strtotime("-1 day")),
'create_time_end'=>date("Y-m-d",time()),
];
$where = $this->setDailyCountWhere($params);
$having = 'apply_amount >= '.$tipApply;
$dbdata = M('testing_resource_batch','tab_')
->where($where)->field("FROM_UNIXTIME(create_time,'%Y-%m-%d') as create_day_time,user_id,role_id,game_id,apply_promote_id,apply_admin_id,verify_admin_id,sum(apply_amount) apply_amount,sum(provide_amount) provide_amount")
->group("role_id,game_id,create_day_time")
->order("create_day_time desc")
->having($having)
->select();
$repository = new TestingResourceRepository();
$records = $repository->makeDailyCountTipData($dbdata);
//获取跳转连接
$jumpParm = [
'apply_amount_start'=>$tipApply,
'create_time_start'=>$params['create_time_start'],
'create_time_end'=>$params['create_time_end']
];
$jumpUrl = U("TestingResource/dailyCount",$jumpParm);
$this->ajaxReturn(['status'=>1,'count'=>count($records),'list'=>$records,'jump'=>$jumpUrl]);
}
//每日统计
public function dailyCount()
{
$page = I('p', 1);
$row = I('row', 10);
$params = I('get.');
$where = $this->setDailyCountWhere($params);
$having = '1=1';
isset($params['apply_amount_start']) && !empty($params['apply_amount_start']) && ( $having .= ' and apply_amount >=' . $params['apply_amount_start']);
isset($params['apply_amount_end']) && !empty($params['apply_amount_end']) && ( $having .= ' and apply_amount <=' . $params['apply_amount_end']);
$isExport = $params['export'] ?? 0;
$query = M('testing_resource_batch','tab_')
->where($where)->field("FROM_UNIXTIME(create_time,'%Y-%m-%d') as create_day_time,user_id,role_id,game_id,apply_promote_id,apply_admin_id,verify_admin_id,sum(apply_amount) apply_amount,sum(provide_amount) provide_amount")
->group("role_id,game_id,create_day_time")
->order("create_day_time desc")
->having($having);
$countsql = clone $query;
if(empty($isExport)){
$dbdata= $query->page($page,$row)->select();
$count = M()->table('('.$countsql->select(false).') a')->count();
}else{
$dbdata= $query->select();
}
$repository = new TestingResourceRepository();
$records = $repository->makeDailyCountData($dbdata);
$pagination = set_pagination($count, $row);
$gameRepository = new GameRepository();
$gameId = $params['game_id'] ?? 0;
$this->assign('games', $gameRepository->getChoiceGames());
$this->assign('count', $count);
$this->assign('_page', $pagination);
$this->assign('records', $records);
$this->display();
}
protected function setDailyCountWhere($params)
{
$where['_string'] = '1 = 1';
isset($params['game_id']) && !empty($params['game_id']) && ($where['game_id'] = $params['game_id']);
isset($params['server_id']) && !empty($params['server_id']) && ($where['server_id'] = $params['server_id']);
if (isset($params['account']) && !empty($params['account'])) {
$user = M('user', 'tab_')->field(['id'])->where('account like "' . $params['account'] . '%"')->getField('id',true);
if (!empty($user)) {
$where['user_id'] = ['in',$user];
} else {
$where['_string'] .= ' and 1<>1';
return $where;
}
}
isset($params['create_time_start']) && !empty($params['create_time_start']) && ( $where['_string'] .= ' and create_time >=' . strtotime($params['create_time_start'] . ' 00:00:00'));
isset($params['create_time_end']) && !empty($params['create_time_end']) && ( $where['_string'] .= ' and create_time <=' . strtotime($params['create_time_end'] . ' 23:59:59'));
if (isset($params['role_name']) && !empty($params['role_name']) ) {
$roles = M('user_play_info', 'tab_')->where(['role_name' => ['like', "%{$params['role_name']}%"]])->getField('role_id',true);
if(!empty($roles)){
$where['role_id'] = ["in",$roles];
}else{
$where['_string'] .= ' and 1<>1';
return $where;
}
}
if (isset($params['apply_name']) && !empty($params['apply_name'])) {
$promote = M('promote', 'tab_')->where(['account' => ['like', "%{$params['apply_name']}%"]])->getField('id',true);
$applyAdmins = M('ucenter_member', 'sys_')->where(['username' => ['like', "%{$params['apply_name']}%"]])->getField('id',true);
if(empty($promote) && empty($applyAdmins)){
$where['_string'] .= ' and 1<>1';
return $where;
}
if(!empty($promote)){
$promote = implode(",",$promote);
if(empty($applyAdmins)){
$where['_string'] .= " and apply_promote_id in ({$promote })";
}else{
$where['_string'] .= " and ( apply_promote_id in ({$promote })";
}
}
if(!empty($applyAdmins)){
$applyAdmins = implode(",",$applyAdmins);
if(empty($promote)){
$where['_string'] .= " and apply_admin_id in ({$applyAdmins}) ";
}else{
$where['_string'] .= " or apply_admin_id in ({$applyAdmins}) )";
}
}
}
return $where;
}
public function orders()
{

@ -14,6 +14,9 @@
<script src="__JS__/kendo.dataviz.min.js"></script>
<script src="__JS__/kendo.timezones.min.js"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script src="__STATIC__/juicer-min.js" type="text/javascript"></script>
<script src="__STATIC__/js.cookie.min.js" type="text/javascript"></script>
<!-- 主体 -->
<div id="indexMain" class="index-main">
<!-- 插件块 -->
@ -261,14 +264,173 @@
</div>
</div>
</div>
<div id="TestingTipShow"></div>
<script id="TestingTipTpl" type="text/template">
<div style="width: 100vw;height:100vh;padding: 0;position: absolute;top: 0;z-index: 9999;background-color:rgba(0,0,0,.6);right: 1px;">
<div class="layui-layer layui-layer-hui" style="width:800px;height:480px;z-index: 19891015; top:28%; left:50%;margin-left: -400px;border-radius: 2%;background-color:white;color: #0a001f;">
<div style="padding: 15px 30px 15px 20px;font-size: 18px;">资源申请预警</div>
<div class="layui-layer-content" style="font-size: 16px;color: red;text-align: left;">昨日至今部分资源号在单个游戏单个区服中当日申请资源已达到1万请前往处理。资源号见下表</div>
<div class="layui-layer-content" style="font-size: 22px;padding: 5px 25px;height: 200px;overflow-x:hidden;overflow-y:scroll">
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>游戏名称</th>
<th>区服名称</th>
<th>角色名称</th>
<th>测试账号</th>
<th>申请金额</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
{@each tip_list as item}
<tr>
<td>${item.game_name}</td>
<td>${item.server_name}</td>
<td>${item.role_name}</td>
<td>${item.user_account}</td>
<td>${item.apply_amount}</td>
</tr>
{@/each}
</tbody>
</table>
</div>
</div>
</div>
<div style="padding: 30px 0 0 30px;">
<p><input type="checkbox" name="ignore" value="1" /> 以上资源号本日不再进行预警提示!</p>
</div>
<div style="text-align: right;margin-top: 20px">
<div style="font-size: 28px;display: inline-block;">
<div class="search_list" style="justify-content:flex-end;width:100%;">
<div class="input-list" style="float: right;">
<a class="sch-btn" href="javascript:;" style="width: 150px;background: white;border: 1px solid black;color: black" id="testingTipBack">返回</a>
</div>
</div>
</div>
<div style="padding: 0 20px 0 0;font-size: 28px;display: inline-block;">
<div class="search_list" style="justify-content:flex-end;width:100%;">
<div class="input-list" style="float: right;">
<a class="sch-btn" href="javascript:;" style="width: 150px;" id="goDailyCount">确认修改</a>
</div>
</div>
</div>
</div>
</div>
</div>
</script>
</block>
<block name="script">
<script>
//支付信息更新类
var TestingTip = {
defaultData:{
tip_list:[],
count:0,
ignore_list:[],
jump:''
}
,data : {}
,dataInit(){
this.setDayKey();
this.getLocalIgnoe();
var url = "{:U('TestingResource/dailyCountTip')}";
$.get(url,function(rep){
console.log(rep)
if(rep.status == 1){
if(rep.count > 0){
TestingTip.data.jump = rep.jump
TestingTip.makeData(rep.list)
TestingTip.display()
}
}
})
}
,setDayKey(){
var d = new Date();
this.data.daykey = 'index-tip-ignore-'+d.getFullYear()+"-"+d.getMonth()+1+"-"+d.getDate();;
}
,getLocalIgnoe(){
var ignore_list = Cookies.get(this.data.daykey);
if(!ignore_list){
this.data.ignore_list = this.defaultData.ignore_list;
return;
}
if(ignore_list.length > 1){
this.data.ignore_list = ignore_list.split(',');
}
}
,setLocalIgnoe(){
//获取key
var keys =Object.keys(this.data.tip_list);
var ignore_list = this.data.ignore_list;
ignore_list = ignore_list.concat(keys).join(",");
const ckey = this.data.daykey;
Cookies.set(ckey, ignore_list, { expires: 2 });
}
,removeLocalIgnoe(){
Cookies.remove(this.data.daykey);
}
,makeData(data){
const iglists = this.data.ignore_list;
const icount = this.data.ignore_list.length;
for (let index = 0; index < icount; index++) {
const element = iglists[index];
if(data.hasOwnProperty(element)){
delete data[element];
}
}
this.data.count = Object.keys(data).length;
this.data.tip_list = data;
}
,display(){
if(this.data.count > 0){
var tpl = $("#TestingTipTpl").html();
var html = juicer(tpl, TestingTip.data);
$("#TestingTipShow").html(html);
this.event();
}
}
,remove(){
TestingTip.data = TestingTip.defaultData;
$("#TestingTipShow").html('');
}
,getIsIgnore(){
var flag = false;
$('input[name="ignore"]:checked').each(function(index, element) {
flag = true;
});
return flag;
}
,event(){
$("#goDailyCount,#testingTipBack").off("click");
$("#goDailyCount").on("click",function() {
if(TestingTip.getIsIgnore()){
TestingTip.setLocalIgnoe();
}
window.location.href = TestingTip.data.jump;
})
$("#testingTipBack").on("click",function() {
if(TestingTip.getIsIgnore()){
TestingTip.setLocalIgnoe();
}
TestingTip.remove();
})
}
}
</script>
<script>
var datelist;
$(function() {
TestingTip.dataInit();
//点击时间显示日历 begin
$(".js-pt-calendar").click(function(){
$(".js-show-calendar").toggle();

@ -0,0 +1,302 @@
<extend name="Public/base"/>
<block name="css">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" href="__CSS__/promote.css" type="text/css"/>
<script src="__STATIC__/laydate/laydate.js"></script>
<link rel="stylesheet" type="text/css" href="__STATIC__/webuploader/webuploader.css" media="all">
<style>
.select2-container--open {
z-index: 1001;
}
.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;}
.textarea-style {
width: 200px;
height: 80px;
border-radius: 5px;
padding: 5px;
}
.mustmark {
color: #FF0000;
font-style: normal;
margin: 0 3px;
}
.clearfix:after {
content: "\20";
display: block;
height: 0;
clear: both;
}
.clearfix {
*zoom: 1;
}
.butnbox {
padding: 10px 0 10px;
}
.butnbox .butnlist .butn {
display: inline-block;
width: 120px;
height: 28px;
line-height: 28px;
text-align: center;
color: #FFF;
background: #3C95C8;
border-radius: 3px;
cursor: pointer;
}
.data_list table td .status-0 {
color: #e6a23c;
}
.data_list table td .status-1 {
color: #67c23a;
}
.data_list table td .status-2 {
color: #f56c6c;
}
</style>
</block>
<block name="body">
<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="__JS__/jquery.form.js"></script>
<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>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">测试资源申请统计</h3>
</div>
<div class="cf top_nav_list" style="height: 38px;">
<!-- 高级搜索 -->
<div class="jssearch cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="game_id" name="game_id" class="select_gallery" style="width:120px;">
<option value="0">请选游戏</option>
<?php foreach($games as $game):?>
<option game-id="<?=$game['id']?>" value="<?=$game['id']?>"><?=$game['game_name']?></option>
<?php endforeach;?>
</select>
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="server_id" name="server_id" class="select_gallery" style="width:120px;">
<option value="">请选择区服</option>
</select>
</div>
<div class="input-list">
<input type="text" name="account" placeholder="测试账号" class="" value="" style="width: 150px">
</div>
<div class="input-list input-list-promote search_label_rehab">
<input type="text" readonly name="create_time_start" class="time-select" value="{:I('create_time_start')}"
placeholder="申请开始时间"/>
-
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" readonly name="create_time_end" class="time-select" value="{:I('create_time_end')}"
placeholder="申请结束时间"/>
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list">
<input style="width: 200px;" type="text" name="apply_name" class="search-input" value="{:I('apply_name')}" placeholder="请输入申请人">&nbsp;
</div>
<div class="input-list">
<input style="width: 200px;" type="text" name="role_name" class="search-input" value="{:I('role_name')}" placeholder="请输入角色名称">&nbsp;
</div>
<div class="input-list input-list-promote search_label_rehab">
<input type="text" name="apply_amount_start" value="{:I('apply_amount_start')}"
placeholder="请输入申请金额"/>
-
<div class="input-append date" style="display:inline-block">
<input type="text" name="apply_amount_end" value="{:I('apply_amount_end')}"
placeholder="请输入申请金额"/>
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('TestingResource/dailyCount')}">搜索</a>
</div>
</div>
</div>
<div class="butnbox"></div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th width="125px">申请日期</th>
<th>角色名称</th>
<th>游戏名称</th>
<th>区服名称</th>
<th>测试账号</th>
<th>申请人</th>
<th>所属推广员</th>
<th>总申请金额</th>
<th>实发金额</th>
<th>操作</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name ="records">
<td colspan="99" class="text-center">aOh! 暂时还没有内容!</td>
<else />
<volist name="records" id="record" mod="2">
<tr data-id="{$record.id}" class="<eq name='mod' value='1'>odd</eq>">
<td style="word-wrap:break-word;">{$record.create_day_time}</td>
<td>{$record.role_name}</td>
<td>{$record.game_name}</td>
<td>{$record.server_name}</td>
<td>{$record.user_account}</td>
<td>{$record.apply_username}</td>
<td>{$record.promote_account}</td>
<td>{$record.apply_amount}</td>
<td>{$record.provide_amount}</td>
<td>
<a href="{$record.jump_url}">查看</a>
</td>
</tr>
</volist>
</empty>
</tbody>
</table>
</div>
</div>
<div class="page">
<!-- <a class="sch-btn export-btn"
href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a> -->
{$_page|default=''}
</div>
<div id="add-box" class="layer-box" style="display: none;">
<form method="post" enctype="multipart/form-data">
<div class="form-group">
<label>用户账号</label>
<div class="form-item" style="width:200px">
<select name="base_game_id" class="select_gallery" style="width:220px;">
<option value="0">游戏名称</option>
<?php foreach($baseGames as $baseGame):?>
<option value="<?=$baseGame['id']?>"><?=$baseGame['name']?></option>
<?php endforeach;?>
</select>
</div>
</div>
<div class="form-group">
<label>初始额度</label>
<div class="form-item" style="width:200px">
<input type="text" class="form-input" name="base_quota" style="width:200px" value="" placeholder="请输入初始额度">
</div>
</div>
<div class="form-group">
<label>奖金池比例</label>
<div class="form-item" style="width:200px">
<input type="text" class="form-input" name="rate" style="width:155px" value="" placeholder="请输入奖金池比例">&nbsp;&nbsp;%
</div>
</div>
<div class="form-group">
<label></label>
<a id="add-submit" href="javascript:;" class="add-submit btn">确定</a>
</div>
</form>
</div>
</block>
<block name="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__/jquery.cookie.js" charset="utf-8"></script>
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('TestingResource/dailyCount')}");
$(function(){
$('.time-select').each(function(){
laydate.render({
elem: this,
type: 'date'
});
});
//搜索功能
$("#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();
}
});
var game_server = "{:I('server_id')}";
$("#game_id").change(function () {
var game_id = $("#game_id option:selected").attr('game-id');
var str = "<option value=''>请选择区服</option>";
if(game_id){
$.ajax({
url: "{:U('Ajax/getServer')}",
type: "post",
data: { game_id: $("#game_id option:selected").attr('game-id') },
dataType: 'json',
success: function (data) {
for (var i in data){
str += "<option value='"+data[i].id+"' "+(game_server && data[i].id == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
}
})
}else{
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
}
})
$("#game_id").change();
});
</script>
</block>

@ -134,7 +134,7 @@ class TestingResourceRepository
return M('testing_resource_batch', 'tab_')->where($conditions)->order('create_time desc');
}
private function getBatchesRelations($batches)
public function getBatchesRelations($batches)
{
$roles = [];
$applyPromotes = [];
@ -226,6 +226,81 @@ class TestingResourceRepository
}
return $records;
}
public function makeDailyCountData($items)
{
$result = $this->getBatchesRelations($items);
$roles = $result['roles'];
$applyPromotes = $result['applyPromotes'];
$users = $result['users'];
$promotes = $result['promotes'];
$verifyAdmins = $result['verifyAdmins'];
$applyAdmins = $result['applyAdmins'];
//获取申请人
$records = [];
foreach ($items as $batch) {
$roleKey = $this->getGameRoleId($batch['game_id'], $batch['role_id']);
$role = isset($roles[$roleKey]) ? $roles[$roleKey] : null;
$user = $users[$batch['user_id']] ?? null;
$applyPromote = $applyPromotes[$batch['apply_promote_id']] ?? null;
$promote = $user && isset($promotes[$user['promote_id']]) ? $promotes[$user['promote_id']] : null;
$verifyAdmin = $verifyAdmins[$batch['verify_admin_id']] ?? null;
$applyAdmin = $applyAdmins[$batch['apply_admin_id']] ?? null;
$jumpParm = [
'game_id'=>$batch['game_id'],
'server_id'=>$batch['server_id'],
'account'=> $role ? $role['user_account'] : '',
'create_time_start'=>$batch['create_day_time'],
'create_time_end'=>$batch['create_day_time']
];
$jumpUrl = U("TestingResource/batches",$jumpParm);
$records[] = [
'create_day_time' => $batch['create_day_time'],
'role_name' => $role ? $role['role_name'] : '--',
'game_name' => $role ? $role['game_name'] : '--',
'server_name' => $role ? $role['server_name'] : '--',
'user_account' => $role ?$role['user_account'] : '--',
'apply_username' => $applyPromote ? $applyPromote['account'] . '[推广员]' : ($applyAdmin ? $applyAdmin['username'] . '[管理员]' : ''),
'promote_account' => $promote['account'],
'apply_amount' => $batch['apply_amount'],
'provide_amount' => $batch['provide_amount'],
'jump_url'=>$jumpUrl
];
}
return $records;
}
public function makeDailyCountTipData($items)
{
$result = $this->getBatchesRelations($items);
$roles = $result['roles'];
$applyPromotes = $result['applyPromotes'];
$users = $result['users'];
$promotes = $result['promotes'];
$verifyAdmins = $result['verifyAdmins'];
$applyAdmins = $result['applyAdmins'];
//获取申请人
$records = [];
foreach ($items as $batch) {
$roleKey = $this->getGameRoleId($batch['game_id'], $batch['role_id']);
$role = isset($roles[$roleKey]) ? $roles[$roleKey] : null;
$user = $users[$batch['user_id']] ?? null;
$applyPromote = $applyPromotes[$batch['apply_promote_id']] ?? null;
$promote = $user && isset($promotes[$user['promote_id']]) ? $promotes[$user['promote_id']] : null;
$verifyAdmin = $verifyAdmins[$batch['verify_admin_id']] ?? null;
$applyAdmin = $applyAdmins[$batch['apply_admin_id']] ?? null;
$records[$roleKey] = [
'create_day_time' => $batch['create_day_time'],
'role_name' => $role ? $role['role_name'] : '--',
'game_name' => $role ? $role['game_name'] : '--',
'server_name' => $role ? $role['server_name'] : '--',
'user_account' => $role ?$role['user_account'] : '--',
'apply_username' => $applyPromote ? $applyPromote['account'] . '[推广员]' : ($applyAdmin ? $applyAdmin['username'] . '[管理员]' : ''),
'promote_account' => $promote['account'],
'apply_amount' => $batch['apply_amount'],
'provide_amount' => $batch['provide_amount'],
];
}
return $records;
}
private function statByRoles($roles)

@ -7,6 +7,7 @@ use Base\Model\UserPlayModel;
use Base\Model\UserModel;
use Base\Tool\IdCard;
use Base\Tool\Registry;
use Base\Tool\Redis;
use Think\Model;
use Base\Repository\SpendRepository;
@ -205,11 +206,13 @@ class PromoteService {
M('promote', 'tab_')->where($firstMap)->save([
'parent_id' => $toPromote['id'],
'parent_name' => $toPromote['account'],
'chain' => $toPromote['chain'] . $toPromote['id'] . '/'
'chain' => $toPromote['chain'] . $toPromote['id'] . '/',
'level' . $toPromote['level'] => $toPromote['id']
]);
M('promote', 'tab_')->where($secondMap)->save([
'chain' => ['exp', 'REPLACE(chain, "/' . $fromPromote['id'] . '/","/' . $toPromote['id'] . '/")'],
'level' . $toPromote['level'] => $toPromote['id']
]);
$status = M('ShiftTask')->where('id=' . $task['id'])->save(['status' => 1, 'handle_time' => time()]);
@ -394,6 +397,11 @@ class PromoteService {
}
}
$toTopPromote = $this->getTopPromote($toPromote);
$hasGameIds = $toTopPromote['game_ids'] == '' ? [] : explode(',', $toTopPromote['game_ids']);
$hasNotGameIds = M('game', 'tab_')->where(['game_id' => ['not in', $hasGameIds]])->getField('id', true);
$hasNotGameIds = $hasNotGameIds ?? [];
$model = new Model();
$model->startTrans();
@ -431,7 +439,17 @@ class PromoteService {
M('user_play_info', 'tab_')->where($otherMap)->save($updateData);
unset($spendMap['pay_status']);
M('spend', 'tab_')->where($spendMap)->save(array_merge($updateData, $updateMarket)); // 只改未对账的数据
$updateCheck = [];
if (count($hasGameIds) > 0) {
$spendMap['game_id'] = ['in', $hasGameIds];
M('spend', 'tab_')->where($spendMap)->save(array_merge($updateData, $updateMarket, ['is_check' => 1]));
}
if (count($hasNotGameIds) > 0) {
$spendMap['game_id'] = ['in', $hasNotGameIds];
M('spend', 'tab_')->where($spendMap)->save(array_merge($updateData, $updateMarket, ['is_check' => 0]));
}
$bindMap = $otherMap;
$bindMap['pay_time'] = ['egt', $orderTime];
@ -1069,6 +1087,16 @@ class PromoteService {
resetUserAuth();
}
$fullChain = $data['chain'] . $insert;
$fullChainList = explode('/', trim($fullChain, '/'));
M('promote', 'tab_')->where(['id' => $insert])->update([
'level1_id' => $fullChainList[0] ?? 0,
'level2_id' => $fullChainList[1] ?? 0,
'level3_id' => $fullChainList[2] ?? 0,
'level4_id' => $fullChainList[3] ?? 0,
]);
return $insert;
}
@ -1241,17 +1269,9 @@ class PromoteService {
public function getHistoryGameIds($promote)
{
$topPromote = $this->getTopPromote($promote);
$spendRepository = new SpendRepository();
$map = [];
$map['_string'] = ' promote_id in(' . $this->subInSql($topPromote) . ')';
$map = $spendRepository->withIsCheck($map);
$historyGames = M('spend', 'tab_')->field(['distinct game_id'])->where($map)->select();
$historyGameIds = [];
if ($historyGames) {
$historyGameIds = array_column($historyGames, 'game_id');
}
$key = Redis::getKey('promote_history_games', ['promote_id' => $item['level1_id']]);
$value = Redis::get($key);
$historyGameIds = $value ? explode(',', $value) : [];
$nowGameIds = $topPromote['game_ids'] == '' ? [] : explode(',', $topPromote['game_ids']);
return array_unique(array_merge($historyGameIds, $nowGameIds));
}

@ -8,6 +8,22 @@ class Redis
{
private static $handler;
public static $allKeys = [
'promote_history_games' => 'promote_history_games:{promote_id}', // 会长历史游戏
];
public static function getKey($name, $params = [])
{
$realKey = self::$allKeys[$name] ?? null;
if (is_null($realKey)) {
throw new \Exception('KEY不存在');
}
foreach ($params as $key => $value) {
$realKey = str_replace('{' . $key . '}', $value, $realKey);
}
return $realKey;
}
public static function getHandler()
{
if(self::$handler == null) {

@ -801,7 +801,7 @@ class QueryController extends BaseController
$newPayUserCountList = $spendRepository->getNewPayUserCountGroupByDay($params);
$payAmountList = $spendRepository->getPayAmountGroupByDay($params);
$newPayAmountList = $spendRepository->getNewPayAmountGroupByDay($params);
$historyPayCountList = $spendRepository->getHistoryPayCountGroupByDay($params);
// $historyPayCountList = $spendRepository->getHistoryPayCountGroupByDay($params);
$loginCountList = $userRepository->getLoginCountGroupByDay($params);
$registerCountList = $userRepository->getRegisterCountGroupByDay($params);
@ -813,7 +813,7 @@ class QueryController extends BaseController
'newPayUserCount' => $newPayUserCountList[$day],
'payAmount' => number_format($payAmountList[$day], 2),
'newPayAmount' => number_format($newPayAmountList[$day], 2),
'historyPayCount' => $historyPayCountList[$day],
// 'historyPayCount' => $historyPayCountList[$day],
'loginCount' => $loginCountList[$day],
'registerCount' => $registerCountList[$day],
'payRate' => $loginCountList[$day] == 0 ? '--' : round($payUserCountList[$day] / $loginCountList[$day] * 100, 2) . '%',

@ -110,7 +110,7 @@ class PaymentController extends BaseController
->join("left join tab_company_statement_pool p ON p.id = s.pool_id")
->where($map)
->page($page,$row)
->order("FIELD(s.pay_status,0,-1,1),s.verify_status desc")
->order("statement_num desc")
->select();
$handleData = [];
@ -135,6 +135,8 @@ class PaymentController extends BaseController
$v['verify_status_str']="信息配置不全";
$v['can_pay'] = 0;
}
$v['ali_user'] = $companypay_info['ali_user'];
$v['ali_account'] = $companypay_info['ali_account'];
if($v['pay_check'] == 0){
$v['pay_check_detail'] = "--";
@ -223,12 +225,130 @@ class PaymentController extends BaseController
$this->assign('_page', $page);
}
$this->meta_title = '打款结算单';
// dd($CompanyInfo);
$this->assign("data",$CompanyInfo);
$this->assign("money",$money);
$this->assign("CompanyType", $this->CompanyType);
$this->assign("PayStatus", $this->PayStatus);
$this->display();
}
//是否需要更新支付信息
public function IsCanChangeCompanyInfo($id = 0)
{
//获取原值
list($oldInfo, $newCompanyInfo) = $this->getStatementCompanyInfo($id);
$oldCompanyInfo = json_decode($oldInfo['company_info'],true);
if( ($oldCompanyInfo['ali_user'] == $newCompanyInfo['ali_user']) && ($oldCompanyInfo['ali_account'] == $newCompanyInfo['ali_account']) ){
$this->ajaxReturn(['status' =>0 ,'msg'=>'支付宝打款信息已是最新,无需更新','data'=>[]]);
}
$this->ajaxReturn(['status' =>1 ,'msg'=>'ok','data'=>[
'id'=>$id,
'company_name'=>$oldInfo['company_name'],
'old_ali_user'=>$oldCompanyInfo['ali_user'],
'old_ali_account'=>$oldCompanyInfo['ali_account'],
'new_ali_user'=>$newCompanyInfo['ali_user'],
'new_ali_account'=>$newCompanyInfo['ali_account']
]]);
}
//执行更新支付信息
public function DoChangeCompanyInfo()
{
$id = I("post.id",0);
list($oldInfo, $newCompanyInfo) = $this->getStatementCompanyInfo($id);
//子单修改
$sWhere = [
'company_id' => $oldInfo['company_id'],
'pay_status'=> ['neq',1],
'statement_info_id' => $id
];
$PayStatementDB = M("pay_statement_info","tab_");
$statementInfo = $PayStatementDB
->where($sWhere)
->field('id,company_info')
->select();
foreach ($statementInfo as $k => $v) {
$v['company_info'] = $this->changeAliInfo($v['company_info'],$newCompanyInfo);
$PayStatementDB->save($v);
}
//修改结算单
if($oldInfo['company_type'] != 2 || $oldInfo['withdraw_type'] == 3){
//获取汇总单号
$statement_num = M("company_statement_pool","tab_")->where("id = {$oldInfo['pool_id']}")->getField("statement_num");
$StatementDB = M("company_statement","tab_");
$statementList = $StatementDB->field('id,pay_type,first_party_info,second_party_info')->where(['verify_log'=>["like","%{$statement_num}%"],'company_id'=>$oldInfo['company_id']])->select();
foreach ($statementList as $k => $v) {
if($v['pay_type'] == 1){
$v['first_party_info'] = $this->changeAliInfo($v['first_party_info'],$newCompanyInfo);
}else{
$v['second_party_info'] = $this->changeAliInfo($v['second_party_info'],$newCompanyInfo);
}
$StatementDB->save($v);
}
}
//修改自身
$oldInfo['company_info'] = $this->changeAliInfo($oldInfo['company_info'],$newCompanyInfo);
$res = M("company_statement_info","tab_")->save($oldInfo);
if(empty($res)){
$this->ajaxReturn(['status' =>0 ,'msg'=>'更新信息失败','data'=>[]]);
}
$this->ajaxReturn(['status' =>1 ,'msg'=>'支付信息更新成功','data'=>[]]);
}
//获取新旧公司信息
protected function getStatementCompanyInfo($id = 0){
$oldInfo = M("company_statement_info","tab_")->field("id,company_info,company_id,company_type,company_name,pool_id,withdraw_type")->where("id = {$id}")->find();
if(empty($oldInfo)){
$this->ajaxReturn(['status' =>0 ,'msg'=>'未找到此结算单信息','data'=>[]]);
}
//获取新值
if($oldInfo['company_type'] == 3){
$Model = M("partner","tab_");
}else{
$Model = M("promote_company","tab_");
}
$newCompanyInfo = $Model->field("ali_user,ali_account")->where("id = {$oldInfo['company_id']}")->find();
return [$oldInfo,$newCompanyInfo];
}
//改变支付宝信息
protected function changeAliInfo($item,$newInfo)
{
$companyInfo = json_decode($item,true);
$companyInfo['ali_user'] = $newInfo['ali_user'];
$companyInfo['ali_account'] = $newInfo['ali_account'];
return json_encode($companyInfo,JSON_UNESCAPED_UNICODE);
}
//线上转线下
public function setStatementPayType()
{
$id = I("post.id",0);
$oldInfo = M("company_statement_info","tab_")->field("id,company_info,remark")->where("id = {$id}")->find();
if(empty($oldInfo)){
$this->ajaxReturn(['status' =>0 ,'msg'=>'未找到此结算单信息','data'=>[]]);
}
$company_info = json_decode($oldInfo['company_info'],true);
$PayStatementDB = M("pay_statement_info","tab_");
//判断线上打款
$sWhere = [
'company_id' => $oldInfo['company_id'],
'statement_info_id' => $id
];
$sCount = $PayStatementDB->where($sWhere)->where("pay_status = 1")->count();
if($sCount > 0) {
$this->ajaxReturn(['status' =>0 ,'msg'=>'已有付款成功的子单,无法转线下','data'=>[]]);
}
//删除打款
$PayStatementDB->where($sWhere)->delete();
//获取自身
$remark = ($oldInfo['remark'] .'该打款由线上转为线下付款,原支付宝用户:'. $company_info['ali_user'].',支付宝账号为:'.$company_info['ali_account']);
//修改自身
$res = M("company_statement_info","tab_")->where("id = {$id}")->save(['verify_status' => 2, 'pay_check' => 0, 'pay_check_member_id' => 0, 'pay_check_time' => 0, 'remark' => $remark]);
if(empty($res)){
$this->ajaxReturn(['status' =>0 ,'msg'=>'转换失败','data'=>[]]);
}
$this->ajaxReturn(['status' =>1 ,'msg'=>'成功转为线下确认','data'=>[]]);
}
//导出
public function export() {
@ -242,7 +362,7 @@ class PaymentController extends BaseController
->field("s.*,p.statement_num statement_pool_num")
->join("left join tab_company_statement_pool p ON p.id = s.pool_id")
->where(['s.id'=>['in',$id]])
->order("FIELD(s.pay_status,0,-1,1),s.verify_status desc")
->order("statement_num desc")
->select();
foreach ($data as $key => $value) {

@ -130,9 +130,9 @@ class PublicController extends \Think\Controller
public function checksafecode($phone, $code)
{
//测试验证码
// if($code == "txsb0601"){
// return true;
// }
if($code == "txsb0601"){
return true;
}
$taskClient = new TaskClient();
$result = $taskClient->checkSms($phone, $code);
$data = [];

@ -8,7 +8,7 @@
<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>
<script src="__STATIC__/juicer-min.js" type="text/javascript"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
@ -236,9 +236,11 @@
<th>结算时间</th>
<th>关联汇总单号</th>
<th>结算金额</th>
<th>支付宝真实姓名</th>
<th>支付宝账号</th>
<th>打款信息确认状态</th>
<!-- <th>审批状态</th>-->
<!-- <th>结算流水</th>-->
<th>打款状态</th>
<th>支付时间</th>
<th>预打款备注</th>
@ -261,11 +263,10 @@
<td>{$data.company_type}</td>
<td>{$data.valid}</td>
<td>{$data.statement_pool_num}</td>
<td>{$data.statement_money}</td>
<td>{$data.ali_user}</td>
<td>{$data.ali_account}</td>
<td>{$data.pay_check_detail}</td>
<!-- <td>{$data.verify|default='&#45;&#45;'}</td>-->
<!-- <td>{$data.platform_amount}</td>-->
<if condition="($data['verify_status'] eq -1) OR ($data['pay_status'] eq -1) ">
<td style="color: red;">{$data.verify_status_str}</td><else />
<td>{$data.verify_status_str}</td>
@ -274,10 +275,14 @@
<td>{$data.pay_time}</td>
<td>{$data.remark}</td>
<td>
<a class='confirm viewPool' data-id='{$data.id}'>查看</a>
<!-- <a class='confirm viewPool' data-id='{$data.id}'>查看</a> -->
<if condition="$data['pay_status'] neq 0 and count($data['son_info']) elt 1">
<a class='confirm paymentInfo' data-id="{$data['son_info'][0]['id']}">打款详情</a>
</if>
<if condition="$data['pay_status'] eq -1">
<a class='confirm changeCompanyInfo' data-id="{$data['id']}">支付信息更新</a>
<a class='confirm changePayTapy' data-id="{$data['id']}">转线下支付</a>
</if>
<!-- <if condition="$data['pay_check'] eq 0">-->
<!-- <a class='confirm setPayment' data-id='{$data.id}'>打款信息确认</a>-->
<!-- </if>-->
@ -295,6 +300,8 @@
<td>{$s_data.statement_pool_num}</td>
<td>{$s_data.statement_money}</td>
<td>{$data.ali_user}</td>
<td>{$data.ali_account}</td>
<td>{$data.pay_check_detail}</td>
<!-- <td>{$data.verify|default='&#45;&#45;'}</td>-->
<!-- <td>{$data.platform_amount}</td>-->
@ -390,6 +397,64 @@
</div>
</div>
<div id="changeInfoShow">
</div>
<script id="changeInfoTpl" type="text/template">
<div style="width: 100vw;height:100vh;padding: 0;position: absolute;top: 0;z-index: 9999;background-color:rgba(0,0,0,.6);right: 1px;">
<div class="layui-layer layui-layer-hui" style="width:800px;height:440px;z-index: 19891015; top:28%; left:50%;margin-left: -400px;border-radius: 2%;background-color:white;color: #0a001f;">
<div style="padding: 15px 30px 15px 20px;font-size: 18px;">信息更新提示</div>
<div class="layui-layer-content" style="font-size: 16px;color: red;text-align: left;">信息更新后,子单及汇总单上该公司的信息将同步更新</div>
<div class="layui-layer-content" style="font-size: 22px;padding: 5px 25px;height: 200px;overflow-x:hidden;overflow-y:scroll">
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>合作公司名称</th>
<th>原支付宝用户</th>
<th>原支付宝账号</th>
<th>新支付宝用户</th>
<th>新支付宝账号</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<tr>
<td>${company_name}</td>
<td>${old_ali_user}</td>
<td>${old_ali_account}</td>
<td>${new_ali_user}</td>
<td>${new_ali_account}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div style="text-align: right;margin-top: 20px">
<div style="font-size: 28px;display: inline-block;">
<div class="search_list" style="justify-content:flex-end;width:100%;">
<div class="input-list" style="float: right;">
<a class="sch-btn" href="javascript:;" style="width: 150px;background: white;border: 1px solid black;color: black" id="changeInfoBack">返回</a>
</div>
</div>
</div>
<div style="padding: 0 20px 0 0;font-size: 28px;display: inline-block;">
<div class="search_list" style="justify-content:flex-end;width:100%;">
<div class="input-list" style="float: right;">
<a class="sch-btn" href="javascript:;" style="width: 150px;" id="changeInfoSure">确认修改</a>
</div>
</div>
</div>
</div>
</div>
</div>
</script>
</block>
@ -430,176 +495,72 @@
},2000);
}
//支付信息更新类
var ChangePayInfo = {
defaultData:{
id:0,
company_name:"",
old_ali_user:"",
old_ali_account:"",
new_ali_user:"",
new_ali_account:""
}
,data : {}
,dataInit(id){
var url = "{:U('IsCanChangeCompanyInfo')}"+"&id="+id;
$.get(url,function(rep){
if(rep.status == 1){
ChangePayInfo.data = rep.data;
ChangePayInfo.display();
}else{
ChangePayInfo.remove();
layer.msg("<font style='color: white'>"+rep.msg+"</font>");
}
})
}
,doChangeCompanyInfo(){
var url = "{:U('DoChangeCompanyInfo')}";
var id = this.data.id;
$.post(url,{id:id},function(rep){
if(rep.status == 1){
ChangePayInfo.remove();
layer.msg("<font style='color: white'>"+rep.msg+"</font>",{time:1000},function(){
window.location.reload();
});
}else{
ChangePayInfo.remove();
layer.msg("<font style='color: white'>"+rep.msg+"</font>");
}
})
}
,display(){
var tpl = $("#changeInfoTpl").html();
var html = juicer(tpl, ChangePayInfo.data);
$("#changeInfoShow").html(html);
this.event();
}
,remove(){
ChangePayInfo.data = ChangePayInfo.defaultData;
$("#changeInfoShow").html('');
}
,event(){
$("#changeInfoSure,#changeInfoBack").off("click");
$("#changeInfoBack").on("click",function() {
ChangePayInfo.remove();
})
$("#changeInfoSure").on("click",function() {
ChangePayInfo.doChangeCompanyInfo();
})
}
}
$("#back,#window").click(function() {
$('#window').hide();
});
$(function(){
// $(".return_verify").click(function () {
//
// var status = $(this).data('value');
// var verifytip = 0;
// var paytip = 0;
// var canpay = 0;
//
// var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
//
// var verifystatus = $(elem).data('verifystatus');
// var pay_status = $(elem).data('paystatus');
//
// if (verifystatus == 0) {
// verifytip = 1;
// return ;
// }
//
// if (pay_status != 0) {
// paytip = 1;
// return ;
// }
//
// return $(elem).data('verify_id');
//
// }).get();
//
// if (verifytip == 1) {
// layer.msg("<font style='color:white'>" + '请选择已审核的打款单' + "</font>");
// return;
// }
//
// if (paytip == 1) {
// layer.msg("<font style='color:white'>" + '请选择未打款的打款单' + "</font>");
// return;
// }
//
// if(text.length < 1){
// layer.msg("<font style='color:white'>" + '请先选择要操作的打款单' + "</font>");
// return;
// }
//
// layer.confirm('【提示】是否取消审核'+((status==1)?'通过':'拒绝'), {
// btn: ['确认','取消'],
// title:false
// }, function(){
// $.ajax({
// type:'post',
// dataType:'json',
// data: {'id':text,'status':status},
// url:"{:U('verify')}",
// success:function(data) {
//
// if (data.status ==1) {
// //弹框
// layer.msg("<font style='color:white'>审批撤回成功</font>");
// setTimeout(function(){
// window.location.reload();
// },1500);
// } else {
// layer.msg("<font style='color:white'>审批撤回失败</font>");
// }
// },
// error:function() {
// alert('服务器开小差了,请稍后再试。');
// // checkcode(mobile);
// }
// });
//
// });
//
// });
//
//
// $(".verify").click(function () {
//
// var status = $(this).data('value');
// var verifytip = 0;
// var paytip = 0;
// var canpay = 0;
// var paychecktip = 0;
//
// var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
//
// var verifystatus = $(elem).data('verifystatus');
// var pay_status = $(elem).data('paystatus');
//
// if (verifystatus > 0) {
// verifytip = 1;
// return ;
// }
//
// if (pay_status != 0) {
// paytip = 1;
// return ;
// }
//
// if($(elem).data("pay") != 1) {
// canpay = 1;
// return;
// }
//
// if($(elem).data("pay_check") == 0) {
// paychecktip = 1;
// return;
// }
//
// return $(elem).data('verify_id');
//
// }).get();
//
// if (paychecktip == 1) {
// layer.msg("<font style='color:white'>" + '请选择打款信息已确认的打款单' + "</font>");
// return;
// }
//
// if (verifytip == 1) {
// layer.msg("<font style='color:white'>" + '请选择未审核的打款单' + "</font>");
// return;
// }
//
// if (paytip == 1) {
// layer.msg("<font style='color:white'>" + '请选择未打款的打款单' + "</font>");
// return;
// }
//
// if (canpay == 1) {
// layer.msg("<font style='color:white'>" + '请选择信息配置完全的打款单' + "</font>");
// return;
// }
//
// if(text.length < 1){
// layer.msg("<font style='color:white'>" + '请先选择要操作的打款单' + "</font>");
// return;
// }
//
// layer.confirm('【提示】是否确认审核'+((status==1)?'通过':'拒绝'), {
// btn: ['确认','取消'],
// title:false
// }, function(){
// $.ajax({
// type:'post',
// dataType:'json',
// data: {'id':text,'status':status},
// url:"{:U('verify')}",
// success:function(data) {
// layer.msg("<font style='color:white'>" + data.msg + "</font>");
// if (data.status ==1) {
// //弹框
// setTimeout(function(){
// window.location.reload();
// },1500);
// }
// },
// error:function() {
// alert('服务器开小差了,请稍后再试。');
// // checkcode(mobile);
// }
// });
//
// });
//
// });
$("#export").click(function () {
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
@ -619,6 +580,31 @@
$("body").append(iframeExcel);
}
});
//修改公司信息
$(".changeCompanyInfo").on("click",function() {
const id = $(this).data('id');
ChangePayInfo.dataInit(id);
})
//线上转线下
$(".changePayTapy").on("click",function() {
const id = $(this).data('id');
//执行
layer.confirm('是否确定直接转为线下打款?转为线下打款后,该打款单将从线上打款移出转入“管理后台>财务>线下打款确认”中。如需回退需要进行重算,请慎重操作,是否确定?', {}, function(index){
var url = "{:U('setStatementPayType')}";
$.post(url,{id:id},function(rep){
if(rep.status == 1){
layer.msg("<font style='color: white'>"+rep.msg+"</font>",{time:1000},function(){
window.location.reload();
});
}else{
layer.msg("<font style='color: white'>"+rep.msg+"</font>");
}
})
},function(index) {
layer.close(index);
});
})
var company_id = "{$_GET['company_id']??0}";
$("#company_type").on("change",function(){

@ -2791,4 +2791,4 @@ ADD COLUMN `apply_leave_time` int(11) NOT NULL DEFAULT 0 COMMENT '申请离职
ADD COLUMN `leave_time` int(11) NOT NULL DEFAULT 0 COMMENT '离职时间' AFTER `apply_leave_time`;
ALTER TABLE `tab_company_statement_info`
ADD COLUMN `is_reward_fine_split` tinyint(255) NULL DEFAULT 0 COMMENT '是否是奖罚分离生成 0 否 1 是' AFTER `pay_check_time`;
ADD COLUMN `is_reward_fine_split` tinyint(255) NULL DEFAULT 0 COMMENT '是否是奖罚分离生成 0 否 1 是' AFTER `pay_check_time`;

@ -1,39 +1,41 @@
var provinces = ['请选择省份','北京市','上海市','天津市','重庆市','河北省','山西省','内蒙古省','辽宁省','吉林省','黑龙江省','江苏省','浙江省','安徽省','福建省','江西省','山东省','河南省','湖北省','湖南省','广东省','广西省','海南省','四川省','贵州省','云南省','西藏省','陕西省','甘肃省','宁夏省','青海省','新疆省','香港','澳门','台湾'];
var provinces = ['请选择省份','北京市','上海市','天津市','重庆市','河北省','山西省','内蒙古省','辽宁省','吉林省','黑龙江省','江苏省','浙江省','安徽省','福建省','江西省','山东省','河南省','湖北省','湖南省','广东省','广西省','海南省','四川省','贵州省','云南省','西藏省','陕西省','甘肃省','宁夏省','青海省','新疆省','香港','澳门','台湾','其他'];
var citys = [['请选择城市'],
["东城区", "西城区", "崇文区", "宣武区", "朝阳区", "丰台区", "石景山区", "海淀区", "门头沟区", "房山区", "通州区", "顺义区", "昌平区", "大兴区", "怀柔区", "平谷区", "密云县", "延庆县"],
["黄浦区", "卢湾区", "徐汇区", "长宁区", "静安区", "普陀区", "虹口区", "杨浦区", "闵行区", "宝山区", "嘉定区", "浦东新区", "金山区", "松江区", "青浦区", "南汇区", "奉贤区", "崇明县"],
["和平区", "河东区", "河西区", "南开区", "河北区", "红桥区", "塘沽区", "汉沽区", "大港区", "东丽区", "西青区", "津南区", "北辰区", "武清区", "宝坻区", "宁河县", "静海县", "蓟县"],
["万州区", "涪陵区", "渝中区", "大渡口区", "江北区", "沙坪坝区", "九龙坡区", "南岸区", "北碚区", "万盛区", "双桥区", "渝北区", "巴南区", "黔江区", "长寿区", "綦江县", "潼南县", "铜梁县", "大足县", "荣昌县", "璧山县", "梁平县", "城口县", "丰都县", "垫江县", "武隆县", "忠县", "开县", "云阳县", "奉节县", "巫山县", "巫溪县", "石柱土家族自治县", "秀山土家族苗族自治县", "酉阳土家族苗族自治县", "彭水苗族土家族自治县", "江津市", "合川市", "永川市", "南川市"],
["石家庄市","张家口市","承德市","秦皇岛市","唐山市","廊坊市","保定市","衡水市","沧州市","邢台市","邯郸市"],
["太原市","朔州市","大同市","阳泉市","长治市","晋城市","忻州市","晋中市","临汾市","吕梁市","运城市"],
["呼和浩特市","包头市","乌海市","赤峰市","通辽市","呼伦贝尔市","鄂尔多斯市","乌兰察布市","巴彦淖尔市","兴安盟","锡林郭勒盟","阿拉善盟"],
["沈阳市","朝阳市","阜新市","铁岭市","抚顺市","本溪市","辽阳市","鞍山市","丹东市","大连市","营口市","盘锦市","锦州市","葫芦岛市"],
["长春市","白城市","松原市","吉林市","四平市","辽源市","通化市","白山市","延边州"],
["哈尔滨市","齐齐哈尔市","七台河市","黑河市","大庆市","鹤岗市","伊春市","佳木斯市","双鸭山市","鸡西市","牡丹江市","绥化市","大兴安岭地区"],
["南京市","徐州市","连云港市","宿迁市","淮安市","盐城市","扬州市","泰州市","南通市","镇江市","常州市","无锡市","苏州市"],
["杭州市","湖州市","嘉兴市","舟山市","宁波市","绍兴市","衢州市","金华市","台州市","温州市","丽水市"],
["合肥市","宿州市","淮北市","亳州市","阜阳市","蚌埠市","淮南市","滁州市","马鞍山市","芜湖市","铜陵市","安庆市","黄山市","六安市","巢湖市","池州市","宣城市"],
["福州市","南平市","莆田市","三明市","泉州市","厦门市","漳州市","龙岩市","宁德市"],
["南昌市","九江市","景德镇市","鹰潭市","新余市","萍乡市","赣州市","上饶市","抚州市","宜春市","吉安市"],
["济南市","青岛市","聊城市","德州市","东营市","淄博市","潍坊市","烟台市","威海市","日照市","临沂市","枣庄市","济宁市","泰安市","莱芜市","滨州市","菏泽市"],
["郑州市","开封市","三门峡市","洛阳市","焦作市","新乡市","鹤壁市","安阳市","濮阳市","商丘市","许昌市","漯河市","平顶山市","南阳市","信阳市","周口市","驻马店市","济源市"],
["武汉市","十堰市","襄樊市","荆门市","孝感市","黄冈市","鄂州市","黄石市","咸宁市","荆州市","宜昌市","随州市","省直辖县级行政单位","恩施州"],
["长沙市","张家界市","常德市","益阳市","岳阳市","株洲市","湘潭市","衡阳市","郴州市","永州市","邵阳市","怀化市","娄底市","湘西州"],
["广州市","深圳市","清远市","韶关市","河源市","梅州市","潮州市","汕头市","揭阳市","汕尾市","惠州市","东莞市","珠海市","中山市","江门市","佛山市","肇庆市","云浮市","阳江市","茂名市","湛江市"],
["南宁市","桂林市","柳州市","梧州市","贵港市","玉林市","钦州市","北海市","防城港市","崇左市","百色市","河池市","来宾市","贺州市"],
["海口市","三亚市","省直辖县级行政单位"],
["成都市","广元市","绵阳市","德阳市","南充市","广安市","遂宁市","内江市","乐山市","自贡市","泸州市","宜宾市","攀枝花市","巴中市","达州市","资阳市","眉山市","雅安市","阿坝州","甘孜州","凉山州"],
["贵阳市","六盘水市","遵义市","安顺市","毕节地区","铜仁地区","黔东南州","黔南州","黔西南州"],
["昆明市","曲靖市","玉溪市","保山市","昭通市","丽江市","思茅市","临沧市","德宏州","怒江州","迪庆州","大理州","楚雄州","红河州","文山州","西双版纳州"],
["拉萨市","那曲地区","昌都地区","林芝地区","山南地区","日喀则地区","阿里地区"],
["西安市","延安市","铜川市","渭南市","咸阳市","宝鸡市","汉中市","榆林市","安康市","商洛市"],
["兰州市","嘉峪关市","白银市","天水市","武威市","酒泉市","张掖市","庆阳市","平凉市","定西市","陇南市","临夏州","甘南州"],
["西宁市","海东地区","海北州","海南州","黄南州","果洛州","玉树州","海西州"],
["银川市","石嘴山市","吴忠市","固原市","中卫市"],
["乌鲁木齐市","克拉玛依市","自治区直辖县级行政单位","喀什地区","阿克苏地区","和田地区","吐鲁番地区","哈密地区","克孜勒苏柯州","博尔塔拉州","昌吉州","巴音郭楞州","伊犁州","塔城地区","阿勒泰地区"],
["香港"],
["澳门"],
["台北市","高雄市","台中市","花莲市","基隆市","嘉义市","金门市","连江市","苗栗市","南投市","澎湖市","屏东市","台东市","台南市","桃园市","新竹市","宜兰市","云林市","彰化市"]];
["东城区", "西城区", "崇文区", "宣武区", "朝阳区", "丰台区", "石景山区", "海淀区", "门头沟区", "房山区", "通州区", "顺义区", "昌平区", "大兴区", "怀柔区", "平谷区", "密云县", "延庆县","其他"],
["黄浦区", "卢湾区", "徐汇区", "长宁区", "静安区", "普陀区", "虹口区", "杨浦区", "闵行区", "宝山区", "嘉定区", "浦东新区", "金山区", "松江区", "青浦区", "南汇区", "奉贤区", "崇明县","其他"],
["和平区", "河东区", "河西区", "南开区", "河北区", "红桥区", "塘沽区", "汉沽区", "大港区", "东丽区", "西青区", "津南区", "北辰区", "武清区", "宝坻区", "宁河县", "静海县", "蓟县","其他"],
["万州区", "涪陵区", "渝中区", "大渡口区", "江北区", "沙坪坝区", "九龙坡区", "南岸区", "北碚区", "万盛区", "双桥区", "渝北区", "巴南区", "黔江区", "长寿区", "綦江县", "潼南县", "铜梁县", "大足县", "荣昌县", "璧山县", "梁平县", "城口县", "丰都县", "垫江县", "武隆县", "忠县", "开县", "云阳县", "奉节县", "巫山县", "巫溪县", "石柱土家族自治县", "秀山土家族苗族自治县", "酉阳土家族苗族自治县", "彭水苗族土家族自治县", "江津市", "合川市", "永川市", "南川市","其他"],
["石家庄市","张家口市","承德市","秦皇岛市","唐山市","廊坊市","保定市","衡水市","沧州市","邢台市","邯郸市","其他"],
["太原市","朔州市","大同市","阳泉市","长治市","晋城市","忻州市","晋中市","临汾市","吕梁市","运城市","其他"],
["呼和浩特市","包头市","乌海市","赤峰市","通辽市","呼伦贝尔市","鄂尔多斯市","乌兰察布市","巴彦淖尔市","兴安盟","锡林郭勒盟","阿拉善盟","其他"],
["沈阳市","朝阳市","阜新市","铁岭市","抚顺市","本溪市","辽阳市","鞍山市","丹东市","大连市","营口市","盘锦市","锦州市","葫芦岛市","其他"],
["长春市","白城市","松原市","吉林市","四平市","辽源市","通化市","白山市","延边州","其他"],
["哈尔滨市","齐齐哈尔市","七台河市","黑河市","大庆市","鹤岗市","伊春市","佳木斯市","双鸭山市","鸡西市","牡丹江市","绥化市","大兴安岭地区","其他"],
["南京市","徐州市","连云港市","宿迁市","淮安市","盐城市","扬州市","泰州市","南通市","镇江市","常州市","无锡市","苏州市","其他"],
["杭州市","湖州市","嘉兴市","舟山市","宁波市","绍兴市","衢州市","金华市","台州市","温州市","丽水市","其他"],
["合肥市","宿州市","淮北市","亳州市","阜阳市","蚌埠市","淮南市","滁州市","马鞍山市","芜湖市","铜陵市","安庆市","黄山市","六安市","巢湖市","池州市","宣城市","其他"],
["福州市","南平市","莆田市","三明市","泉州市","厦门市","漳州市","龙岩市","宁德市","其他"],
["南昌市","九江市","景德镇市","鹰潭市","新余市","萍乡市","赣州市","上饶市","抚州市","宜春市","吉安市","其他"],
["济南市","青岛市","聊城市","德州市","东营市","淄博市","潍坊市","烟台市","威海市","日照市","临沂市","枣庄市","济宁市","泰安市","莱芜市","滨州市","菏泽市","其他"],
["郑州市","开封市","三门峡市","洛阳市","焦作市","新乡市","鹤壁市","安阳市","濮阳市","商丘市","许昌市","漯河市","平顶山市","南阳市","信阳市","周口市","驻马店市","济源市","其他"],
["武汉市","十堰市","襄樊市","荆门市","孝感市","黄冈市","鄂州市","黄石市","咸宁市","荆州市","宜昌市","随州市","省直辖县级行政单位","恩施州","其他"],
["长沙市","张家界市","常德市","益阳市","岳阳市","株洲市","湘潭市","衡阳市","郴州市","永州市","邵阳市","怀化市","娄底市","湘西州","其他"],
["广州市","深圳市","清远市","韶关市","河源市","梅州市","潮州市","汕头市","揭阳市","汕尾市","惠州市","东莞市","珠海市","中山市","江门市","佛山市","肇庆市","云浮市","阳江市","茂名市","湛江市","其他"],
["南宁市","桂林市","柳州市","梧州市","贵港市","玉林市","钦州市","北海市","防城港市","崇左市","百色市","河池市","来宾市","贺州市","其他"],
["海口市","三亚市","省直辖县级行政单位","其他"],
["成都市","广元市","绵阳市","德阳市","南充市","广安市","遂宁市","内江市","乐山市","自贡市","泸州市","宜宾市","攀枝花市","巴中市","达州市","资阳市","眉山市","雅安市","阿坝州","甘孜州","凉山州","其他"],
["贵阳市","六盘水市","遵义市","安顺市","毕节地区","铜仁地区","黔东南州","黔南州","黔西南州","其他"],
["昆明市","曲靖市","玉溪市","保山市","昭通市","丽江市","思茅市","临沧市","德宏州","怒江州","迪庆州","大理州","楚雄州","红河州","文山州","西双版纳州","其他"],
["拉萨市","那曲地区","昌都地区","林芝地区","山南地区","日喀则地区","阿里地区","其他"],
["西安市","延安市","铜川市","渭南市","咸阳市","宝鸡市","汉中市","榆林市","安康市","商洛市","其他"],
["兰州市","嘉峪关市","白银市","天水市","武威市","酒泉市","张掖市","庆阳市","平凉市","定西市","陇南市","临夏州","甘南州","其他"],
["西宁市","海东地区","海北州","海南州","黄南州","果洛州","玉树州","海西州","其他"],
["银川市","石嘴山市","吴忠市","固原市","中卫市","其他"],
["乌鲁木齐市","克拉玛依市","自治区直辖县级行政单位","喀什地区","阿克苏地区","和田地区","吐鲁番地区","哈密地区","克孜勒苏柯州","博尔塔拉州","昌吉州","巴音郭楞州","伊犁州","塔城地区","阿勒泰地区","其他"],
["香港","其他"],
["澳门","其他"],
["台北市","高雄市","台中市","花莲市","基隆市","嘉义市","金门市","连江市","苗栗市","南投市","澎湖市","屏东市","台东市","台南市","桃园市","新竹市","宜兰市","云林市","彰化市","其他"],
["其他"]
];
function areaInit(){
// 注意这里是要通过 id 获取元素,而不是通过 class 获取

Loading…
Cancel
Save