diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 5151995f2..d2a649338 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2766,4 +2766,44 @@ function getDateMarket() { // dump($return); return $return; +} + +/** + * 渠道列表 + * @param $type + * @return mixed + */ +function promote_listsMarket($type){ + if($type){ + $map['level'] = $type; + } else{ + $map = ''; + } + +// $promoteRoot = getPowerPromoteIds(); +// if ($promoteRoot) { +// $map['id'] =array('in',$promoteRoot); +// } + + setPowerPromoteIds($map,'id'); + + $admin_id = $_SESSION['onethink_admin']['user_auth']['uid']; + $map['admin_id'] = $admin_id; + if(is_administrator()||session('user_group_id') == 15||session('user_group_id') == 14) { + unset($map['admin_id']); + } + + $data = M('promote','tab_')->where($map)->select(); + + $items = M('PromoteBalanceCoin', 'tab_')->where(['game_id' => 0])->select(); + $records = []; + foreach ($items as $item) { + $records[$item['promote_id']] = $item['num']; + } + foreach ($data as $key => $item) { + $item['common_coin'] = isset($records[$item['id']]) ? $records[$item['id']] : $item['balance_coin']; + $data[$key] = $item; + } + + return $data; } \ No newline at end of file diff --git a/Application/Admin/Controller/MarketPercentageController.class.php b/Application/Admin/Controller/MarketPercentageController.class.php index 008f63455..ffaa123e2 100644 --- a/Application/Admin/Controller/MarketPercentageController.class.php +++ b/Application/Admin/Controller/MarketPercentageController.class.php @@ -20,6 +20,13 @@ class MarketPercentageController extends ThinkController $_REQUEST['relation_game_id']?($map['relation_game_id'] = $_REQUEST['relation_game_id']):''; $_REQUEST['sdk_version']?($map['sdk_version'] = $_REQUEST['sdk_version']):''; + $admin_id = $_SESSION['onethink_admin']['user_auth']['uid']; + $map['admin_id'] = $admin_id; + if(is_administrator()||session('user_group_id') == 15||session('user_group_id') == 14) { + unset($map['admin_id']); + $_REQUEST['admin_id']?($map['admin_id'] = $_REQUEST['admin_id']):''; + } + $search_date = []; if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { @@ -179,6 +186,13 @@ class MarketPercentageController extends ThinkController $_REQUEST['admin_id']?($map['admin_id'] = $_REQUEST['admin_id']):''; $_REQUEST['group_id']?($map['level'] = $_REQUEST['group_id']):''; + $admin_id = $_SESSION['onethink_admin']['user_auth']['uid']; + $map['admin_id'] = $admin_id; + if(is_administrator()||session('user_group_id') == 15||session('user_group_id') == 14) { + unset($map['admin_id']); + $_REQUEST['admin_id']?($map['admin_id'] = $_REQUEST['admin_id']):''; + } + $search_date = []; if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { @@ -754,7 +768,7 @@ class MarketPercentageController extends ThinkController exec("source /etc/profile;cd ".ROOTTT.";php admin.php timing/caculateMarketStream/time/{$pay_time} > /dev/null &"); - $this->success('操作成功,后台正在计算中,请稍后再打开......'); + $this->ajaxReturn(['status'=>1]); } public function showBonusList($row = 10, $p = 1) { diff --git a/Application/Admin/View/MarketPercentage/index.html b/Application/Admin/View/MarketPercentage/index.html index bc8b7c544..4f30b6fbc 100644 --- a/Application/Admin/View/MarketPercentage/index.html +++ b/Application/Admin/View/MarketPercentage/index.html @@ -70,7 +70,7 @@
@@ -342,10 +342,14 @@ dataType: 'json', async: false, success:function(data){ - layer.msg("重新计算需要时间,请等待5分钟后再查看"); - setTimeout(function(){ - window.location.reload(); - },1500); + if(data.status == 1) { + layer.msg("重新计算需要时间,请等待5分钟后再查看"); + setTimeout(function(){ + window.location.reload(); + },1500); + } else { + layer.msg(data.info); + } }, }); }, function(){ diff --git a/Application/Admin/View/MarketPercentage/marketstaffsettle.html b/Application/Admin/View/MarketPercentage/marketstaffsettle.html index 20dce716f..cf9f62329 100644 --- a/Application/Admin/View/MarketPercentage/marketstaffsettle.html +++ b/Application/Admin/View/MarketPercentage/marketstaffsettle.html @@ -334,10 +334,15 @@ dataType: 'json', async: false, success:function(data){ - layer.msg("重新计算需要时间,请等待5分钟后再查看"); - setTimeout(function(){ - window.location.reload(); - },1500); + if(data.status == 1) { + layer.msg("重新计算需要时间,请等待5分钟后再查看"); + setTimeout(function(){ + window.location.reload(); + },1500); + } else { + layer.msg(data.info); + } + }, }); }, function(){ diff --git a/Application/Admin/View/MarketPercentage/personmarketstaffsettle.html b/Application/Admin/View/MarketPercentage/personmarketstaffsettle.html index ce5842dbb..529466816 100644 --- a/Application/Admin/View/MarketPercentage/personmarketstaffsettle.html +++ b/Application/Admin/View/MarketPercentage/personmarketstaffsettle.html @@ -388,10 +388,14 @@ dataType: 'json', async: false, success:function(data){ - layer.msg("重新计算需要时间,请等待5分钟后再查看"); - setTimeout(function(){ - window.location.reload(); - },1500); + if(data.status == 1) { + layer.msg("重新计算需要时间,请等待5分钟后再查看"); + setTimeout(function(){ + window.location.reload(); + },1500); + } else { + layer.msg(data.info); + } }, }); }, function(){ diff --git a/Application/Admin/View/MarketPercentage/showbonuslist.html b/Application/Admin/View/MarketPercentage/showbonuslist.html index d0c1d63e1..d1755c60f 100644 --- a/Application/Admin/View/MarketPercentage/showbonuslist.html +++ b/Application/Admin/View/MarketPercentage/showbonuslist.html @@ -336,10 +336,14 @@ dataType: 'json', async: false, success:function(data){ - layer.msg("重新计算需要时间,请等待5分钟后再查看"); - setTimeout(function(){ - window.location.reload(); - },1500); + if(data.status == 1) { + layer.msg("重新计算需要时间,请等待5分钟后再查看"); + setTimeout(function(){ + window.location.reload(); + },1500); + } else { + layer.msg(data.info); + } }, }); }, function(){