From 6fcaa1362c8f7e281d38008a4eba906a696240d8 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Mon, 21 Sep 2020 14:05:01 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E9=87=8D=E7=BD=AE=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 14 ++++++++++++++ .../Controller/AuthManagerController.class.php | 3 +++ .../Controller/PromoteCompanyController.class.php | 1 + Application/Base/Service/MarketService.class.php | 1 + .../Base/Service/PromoteCompanyService.class.php | 1 + Application/Base/Service/PromoteService.class.php | 1 + 6 files changed, 21 insertions(+) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 39aa08532..b8814f0e9 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -1653,6 +1653,20 @@ function getPowerPromoteIds() return $promoteIds; } +function resetUserAuth() +{ + $userAuth = session('user_auth'); + $adminData = getAdminData($userAuth['uid']); + $groupId = getGameGroup($userAuth['uid']); + $userAuth['data_empower_type'] = $adminData['data_empower_type']; + $userAuth['data_president'] = $adminData['data_president']; + $userAuth['show_data'] = $adminData['show_data']; + session('user_group_id',$groupId); + session('user_auth', $userAuth); + session('user_auth_sign', data_auth_sign($userAuth)); + session('user_auth_promote_ids', null); +} + /** * 为数据权限添加筛选参数 * @param array $map 查询条件 diff --git a/Application/Admin/Controller/AuthManagerController.class.php b/Application/Admin/Controller/AuthManagerController.class.php index c72fca0cf..cbd5bd396 100644 --- a/Application/Admin/Controller/AuthManagerController.class.php +++ b/Application/Admin/Controller/AuthManagerController.class.php @@ -571,6 +571,9 @@ class AuthManagerController extends AdminController{ 'data_president'=>$promoteData, 'show_data'=>$show_data ))) { + + resetUserAuth(); + addOperationLog(array( "op_type"=>1, "key"=> M("AuthGroup")->where("id={$gid}")->field("title")->find()['title'], diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 0e0e997d3..f845ecbdb 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -1262,6 +1262,7 @@ class PromoteCompanyController extends ThinkController $dataPresident = array_diff($dataPresident, $subPromoteIds); } M('auth_group',"sys_")->where(['title'=>'市场总监'])->save(['data_president'=>implode(',', $dataPresident)]); + resetUserAuth(); } } } diff --git a/Application/Base/Service/MarketService.class.php b/Application/Base/Service/MarketService.class.php index e68505fcd..522064a5f 100644 --- a/Application/Base/Service/MarketService.class.php +++ b/Application/Base/Service/MarketService.class.php @@ -47,6 +47,7 @@ class MarketService $dataPresident = explode(',', $authGroup['data_president']); if (!in_array($promote['id'], $dataPresident)) { M('auth_group', 'sys_')->where(['title'=>'市场总监'])->save(['data_president' => $authGroup['data_president'] . ',' . $promote['id']]); + resetUserAuth(); } } diff --git a/Application/Base/Service/PromoteCompanyService.class.php b/Application/Base/Service/PromoteCompanyService.class.php index a34dfe286..0cae4434e 100644 --- a/Application/Base/Service/PromoteCompanyService.class.php +++ b/Application/Base/Service/PromoteCompanyService.class.php @@ -276,6 +276,7 @@ class PromoteCompanyService $dataPresident = array_diff($dataPresident, $subPromoteIds); } M('auth_group', 'sys_')->where(['title' => '市场总监'])->save(['data_president' => implode(',', $dataPresident)]); + resetUserAuth(); } } } diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index 39236b921..5c640d99c 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -1032,6 +1032,7 @@ class PromoteService { $id = M('promote', 'tab_')->getLastInsID(); $info = M('sys_auth_group')->where(['title'=>'市场总监'])->find(); M('sys_auth_group')->where(['title'=>'市场总监'])->save(['data_president'=>$info['data_president'].",".$id]); + resetUserAuth(); } return $insert; From ad34536256ab8373c21cea7a0ff378f1f45aedea Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Mon, 21 Sep 2020 18:40:48 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 11 + .../Controller/FinanceController.class.php | 309 ++++++------------ .../Admin/View/Finance/valueDetail.html | 288 ++++++---------- 3 files changed, 196 insertions(+), 412 deletions(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index b8814f0e9..c80c2022e 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -3102,3 +3102,14 @@ function dateFormat($date) { return date("Y.m.d",strtotime($date)); } + +function getOrderHtml($field, $orderField, $orderType) +{ + if ($orderField == $field && $orderType == 'asc') { + return ''; + } elseif ($orderField == $field && $orderType == 'desc') { + return ''; + } else { + return ''; + } +} \ No newline at end of file diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index 4ecf1027c..b4578608c 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -1446,245 +1446,118 @@ class FinanceController extends ThinkController $this->display(); } - - public function valueDetail($p=1) { - + public function valueDetail($p=1) + { $page = intval($p); $page = $page ? $page : 1; //默认显示第一页数据 $row=10; - if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;} - $nowTime = date('Y-m-d'); - $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); - $initEndTime = date('Y-m-d', time()); - $sort = $_REQUEST['sort']; - if (empty($sort)) { - $sort = 13; - } - if(!empty($_REQUEST['user_account'])) { - $map['account'] = $_REQUEST['user_account']; - $map0['account'] = $_REQUEST['user_account']; - $userId = M('user', 'tab_')->where(['account'=>$_REQUEST['user_account']])->getField('id'); - - $map1['user_id'] = $userId; - $map2['user_id'] = $userId; - $map3['user_id'] = $userId; - $map4['user_id'] = $userId; + if(isset($_REQUEST['row'])) { + $row = $_REQUEST['row']; + } else { + $row = 10; } - if (!empty($_REQUEST['timestart']) && !empty($_REQUEST['timeend'])) { - $map['create_time'] = array('between', [strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 86399]); - - } elseif (!empty($_REQUEST['timestart']) && empty($_REQUEST['timeend'])) { - $map['create_time'] = array('between', [strtotime($_REQUEST['timestart']), time()]); - } elseif (empty($_REQUEST['timestart']) && !empty($_REQUEST['timeend'])) { - $map['create_time'] = array('elt', (strtotime($_REQUEST['timeend']) + 86399)); + $isExport = I('export', 0); + $startedAt = I('timestart', ''); + $endedAt = I('timeend', ''); + $userAccount = I('user_account', ''); + $orderField = I('order_field', ''); + $orderType = I('order_type', ''); - }elseif (empty($_REQUEST['timestart']) && empty($_REQUEST['timeend']) && empty(I('user_account'))) { - $map['create_time'] = array('between', [strtotime($initBegTime), strtotime($initEndTime) + 86399]); - - } - $order = 'id desc'; - if ($sort == 1) { - $order = 'spendvalue desc'; - } - if ($sort == 2) { - $order = 'deposit desc'; + $map = []; + $lastMap = []; + $map['_string'] = $lastMap['_string'] = '1=1'; + if ($startedAt != '') { + $map['_string'] .= ' and create_time >=' . strtotime($startedAt . ' 00:00:00'); } - if ($sort == 3 || $sort == 5) { - $order = 'spendvalue desc'; + if ($endedAt != '') { + $map['_string'] .= ' and create_time <=' . strtotime($endedAt . ' 23:59:59'); + $lastMap['_string'] .= ' and create_time <=' . strtotime($endedAt . ' 23:59:59'); } - if ($sort == 4) { - $order = 'spendvalue asc'; + $userMap = []; + if ($userAccount != '') { + $userMap['account'] = $userAccount; } + $valueSubSql = M('value_detail_log', 'tab_')->field([ + 'abs(IFNULL(sum(IF(pay_type=1,value,0)), 0)) amount1', + 'IFNULL(sum(IF(pay_type=2,value,0)), 0) amount2', + 'IFNULL(sum(IF(pay_type=3,value,0)), 0) amount3', + 'user_id' + ]) + ->where($map) + ->group('user_id') + ->select(false); + + $lastSubSql = M('value_detail_log', 'tab_')->field(['CONVERT(SUBSTRING_INDEX(group_concat(id order by `create_time` desc),",",1), UNSIGNED INTEGER)']) + ->where($lastMap) + ->group('user_id') + ->select(false); + $reaminSubSql = M('value_detail_log', 'tab_')->field('user_id, after_value amount') + ->where(['_string' => 'id in(' . $lastSubSql . ')']) + ->group('user_id') + ->select(false); + + + $this->checkListOrCountAuthRestMap($userMap, []); - if ($sort == 6) { - $order = 'deposit desc'; - } - if ($sort == 7) { - $order = 'deposit asc'; - } + $query = M('user', 'tab_') + ->alias('a') + ->where($userMap) + ->join('left join (' . $valueSubSql . ') b on a.id=b.user_id') + ->join('left join (' . $reaminSubSql . ') c on a.id=c.user_id'); + $countQuery = clone $query; + $sumQuery = clone $query; - if ($sort == 9) { - $order = 'promoteCoin desc'; - } - if ($sort == 10) { - $order = 'promoteCoin asc'; + $order = 'id desc'; + if ($orderField != '') { + $order = $orderField . ' ' . ($orderType == '' ? 'desc' : $orderType); } - if ($sort == 11) { - $order = 'id asc'; - } - if ($sort == 12) { - $order = 'id desc'; - } + $columns = ['a.account', 'a.id', 'a.balance', 'b.amount1 spend_value', 'b.amount2 deposit_value', 'b.amount3 promote_value', 'c.amount remain']; - if ($sort == 16) { - $order = 'restvalue desc'; - } - if ($sort == 17) { - $order = 'restvalue asc'; + $records = []; + if ($isExport == 1) { + $records = $query->field($columns)->order($order)->limit(10000)->select(); + } else { + $records = $query->field($columns)->order($order)->page($page, $row)->select(); } - if ($sort == 19) { - $order = 'totalvalue desc'; + foreach ($records as $key => $record) { + $records[$key]['spend_value'] = number_format(abs(floatval($record['spend_value'])), 2, '.', ''); + $records[$key]['deposit_value'] = number_format(abs(floatval($record['deposit_value'])), 2, '.', ''); + $records[$key]['promote_value'] = number_format(floatval($record['promote_value']), 2, '.', ''); + $records[$key]['remain'] = number_format(floatval($record['remain']), 2, '.', ''); } - if ($sort == 20) { - $order = 'totalvalue asc'; + + $count = $countQuery->count(); + $sumColumns = ['sum(a.balance) balance', 'sum(b.amount1) spend_value', 'sum(b.amount2) deposit_value', 'sum(b.amount3) promote_value', 'sum(c.amount) remain']; + $summary = $sumQuery->field($sumColumns)->find(); + + if($isExport == 1) { + $getData = $_GET; + unset($getData['export']); + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U(CONTROLLER_NAME.'/'.ACTION_NAME,$getData),'menu'=>"财务-数据统计-平台币统计-导出"]); + data2csv($records, '平台币统计', [ + 'id' => '账号ID', + 'account' => '玩家账号', + 'balance' => '当前平台币余额', + 'remain' => '平台币余额', + 'spend_value' => '平台币直充支出', + 'deposit_value' => '平台币直充金额', + 'promote_value' => '后台发放平台币', + ]); } - $this->assign('sorting', $sort); - $map5['v.pay_type'] = 1; - $map5['v.create_time'] = $map['create_time']; - $map5[] = ['u.id = v.user_id'] ; - - $map6[] = ['u.id = v.user_id']; - $map6['v.pay_type'] = 2; - $map6['v.create_time'] = $map['create_time']; - $map7[] = ['u.id = v.user_id']; - $map7['v.pay_type'] = 3; - $map7['v.create_time'] = $map['create_time']; - - $map8[] = ['u.id = v.user_id']; - $map8['v.create_time'] = $map['create_time']; - - $map9[] = ['u.id = v.user_id']; - $map9['v.pay_type'] = 3; - if (!empty($map['create_time'][1][1])) { - $map9['v.create_time'] = ['elt', $map['create_time'][1][1] ]; - } - if (!empty($map['create_time'][1][0]) && empty($map['create_time'][1][1])) { - $map9['v.create_time'] = ['egt', $map['create_time'][1][0] ]; + $page = set_pagination($count, $row); + if($page) { + $this->assign('_page', $page); } - - $valueQuery5 = M('value_detail_log', 'tab_')->alias('v')->field('IFNULL(sum(abs(v.value)), 0) as spend_value') - ->where($map5)->buildSql(); - $valueQuery6 = M('value_detail_log', 'tab_')->alias('v')->field('sum(v.value) as spend_value') - ->where($map6)->buildSql(); - $valueQuery7 = M('value_detail_log', 'tab_')->alias('v')->field('sum(v.value) as spend_value') - ->where($map7)->buildSql(); - $valueQuery9 = M('value_detail_log', 'tab_')->alias('v')->field('IFNULL(sum(abs(v.value)), 0) as spend_value') - ->where($map9)->buildSql(); - $valueQuery8 = M('value_detail_log', 'tab_')->alias('v')->field('after_value')->where($map8)->order('create_time desc')->limit(1)->buildSql(); - $datas = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery8} as totalvalue, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin , if (({$valueQuery8}) - ({$valueQuery9}) > 0, ({$valueQuery8}) - ({$valueQuery9}), 0) as restvalue")->where($map0)->page($page,$row)->order($order)->group('u.id')->select(); - $query = M('user', 'tab_')->alias('u')->field("u.id, u.account, {$valueQuery8} as totalvalue, {$valueQuery5} as spendvalue, {$valueQuery6} as deposit, {$valueQuery7} as promoteCoin , if (({$valueQuery8}) - ({$valueQuery9}) > 0, ({$valueQuery8}) - ({$valueQuery9}), 0) as restvalue")->where($map0)->order($order)->group('u.id')->buildSql(); - $allTotalValue1 = M()->alias('t')->table($query)->sum('t.totalvalue'); - $allRestValue = M()->alias('rest')->table($query)->sum('rest.restvalue'); - - // var_dump($datas);die(); - // $datas = M('user', 'tab_') - // ->field('id, account') - // ->where($map0) - // ->page($page,$row) - // ->order('id desc') - // ->select(); - - $count = M('user', 'tab_') - ->field('id, account') - ->where($map) - ->count(); - $ids = array_column($datas, 'id'); - if(empty($ids)) { - $ids = [-100]; - } - $allDatas = []; - - foreach($datas as $key => $data) { - $id = $data['id']; - $account = $data['account']; - $allDatas[$key]['user_id'] = $id; - $allDatas[$key]['user_account'] = $account; - $spend = $data['spendvalue']; - if(empty($spend)) { - $spend = '0.00'; - }else { - $spend = number_format(abs($spend),2,'.',''); - } - $deposit = $data['deposit']; - if(empty($deposit)) { - $deposit = '0.00'; - } - $promoteCoin = $data['promotecoin']; - if(empty($promoteCoin)) { - $promoteCoin = '0.00'; - } - $restValue = $data['restvalue']; - if(empty($restValue)) { - $restValue = '0.00'; - } - $alltotalvalue = $data['totalvalue']; - if(empty($alltotalvalue)) { - $alltotalvalue = '0.00'; - } - // $allDatas[$key]['bind_balance'] = $bind_balance; - $allDatas[$key]['after_value'] = $alltotalvalue ; - $allDatas[$key]['rest_value'] = $restValue ; - $allDatas[$key]['spend_amount'] = $spend; - $allDatas[$key]['deposit_amount'] = $deposit; - $allDatas[$key]['coin_amount'] = $promoteCoin; - } - $map1['create_time'] = $map['create_time']; - $map1['pay_type'] = 1; - $totalSpend = M('value_detail_log', 'tab_')->where($map1)->sum('value'); - $totalSpend = empty($totalSpend) ? '0.00' : $totalSpend; - $totalSpend = number_format(abs($totalSpend),2,'.',''); - - $map2['create_time'] = $map['create_time']; - $map2['pay_type'] = 2; - $deposit = M('value_detail_log', 'tab_')->where($map2)->sum('value'); - $deposit= empty($deposit) ? '0.00' : number_format($deposit,2,'.',''); - - $map3['create_time'] = $map['create_time']; - $map3['pay_type'] = 3; - $allpromoteCoin = M('value_detail_log', 'tab_')->where($map3)->sum('value'); - $allpromoteCoin = empty($allpromoteCoin) ? '0.00' : number_format($allpromoteCoin,2,'.',''); - $map4['create_time'] = $map['create_time']; - if($_REQUEST['user_account']) { - $banlace = M('value_detail_log', 'tab_')->field('user_id, after_value')->where($map4)->order('create_time desc')->limit(1)->select(); - }else { - $banlace = M('value_detail_log', 'tab_')->field('user_id, after_value')->where($map4)->order('create_time desc')->select(); - } - // $banlaceTotal = '0.00'; - // foreach($banlace as $k222 => $vvv) { - // $banlaceTotal += $vvv['after_value']; - // } - // $banlaceTotal = number_format($banlaceTotal,2,'.',''); - $map['user_id'] = ['in', $ids]; - // $newValueByTimeDatas = M('value_detail_log', 'tab_')->field('user_id, after_value, create_time')->where($map)->order('create_time desc')->limit(1)->select(); - // var_dump($newValueByTimeDatas); - // // var_dump($newValueByTimeDatas);die(); - // foreach ($allDatas as $k => $allData) { - // $allDatas[$k]['after_value'] = "0.00"; - // foreach ($newValueByTimeDatas as $key1 => $newValueByTimeData ) { - // if (intval($allData['user_id']) == intval($newValueByTimeData['user_id'])) { - // $allDatas[$k]['after_value'] = $newValueByTimeData['after_value']; - // break; - // }else { - // $allDatas[$k]['after_value'] = "0.00"; - - // } - // } - - // } - - $this->checkListOrCountAuthRestMap($map,[]); - - $page = set_pagination($count,$row); - if($page) {$this->assign('_page', $page);} - if(empty($_REQUEST['timestart']) && empty($_REQUEST['timeend']) && empty(I('user_account'))) { - $this->assign('starttime', $initBegTime); - $this->assign('endtime', $initEndTime); - }else { - $this->assign('starttime', $_REQUEST['timestart']); - $this->assign('endtime', $_REQUEST['timeend']); - } - $this->assign('banlaceTotal', $allTotalValue1); - $this->assign('total', $totalSpend); - $this->assign('deposit', $deposit); - $this->assign('promoteCoin', $allpromoteCoin); - $this->assign('data', $allDatas); - $this->assign('resttotal', $allRestValue); - + $this->assign('_page', $page); + $this->assign('records', $records); + $this->assign('summary', $summary); + $this->assign('orderField', $orderField); + $this->assign('orderType', $orderType); $this->display(); } diff --git a/Application/Admin/View/Finance/valueDetail.html b/Application/Admin/View/Finance/valueDetail.html index bd31226fe..179221f70 100644 --- a/Application/Admin/View/Finance/valueDetail.html +++ b/Application/Admin/View/Finance/valueDetail.html @@ -90,35 +90,17 @@
+ placeholder="开始时间" autocomplete="off"/> -
+ placeholder="结束时间" autocomplete="off"/>
- - - - - - - - - - - - - - - - - - - - + +
-
@@ -136,83 +117,63 @@ - -
账号ID检测时间最后一秒玩家留存的平台币
- -
账号ID检测时间最后一秒玩家留存的平台币
- - -
账号ID检测时间最后一秒玩家留存的平台币
- -
账号ID检测时间最后一秒玩家留存的平台币
-
+ +
+ 账号ID + 用户ID +
+ 玩家账号 - -
平台币余额检测时间最后一秒玩家留存的平台币
- -
平台币余额检测时间最后一秒玩家留存的平台币
- -
平台币余额检测时间最后一秒玩家留存的平台币
- -
平台币余额检测时间最后一秒玩家留存的平台币
-
- -
平台币直充余额检测时间最后一秒玩家累计消耗的平台币(只记录直充部分)
- -
平台币直充余额检测时间最后一秒玩家累计消耗的平台币(只记录直充部分)
- -
平台币直充余额检测时间最后一秒玩家累计消耗的平台币(只记录直充部分)
- -
平台币直充余额检测时间最后一秒玩家累计消耗的平台币(只记录直充部分)
-
- -
平台币直充支出检测时间内玩家累计消耗的平台币(只记录直充部分)
- -
平台币直充支出检测时间内玩家累计消耗的平台币(只记录直充部分)
- -
平台币直充支出检测时间内玩家累计消耗的平台币(只记录直充部分)
- -
平台币直充支出检测时间内玩家累计消耗的平台币(只记录直充部分)
-
- - -
平台币直充金额检测时间内玩家累计消耗的平台币(只记录直充部分)
- -
平台币直充金额检测时间内玩家累计消耗的平台币(只记录直充部分)
- -
平台币直充金额检测时间内玩家累计消耗的平台币(只记录直充部分)
- -
平台币直充金额检测时间内玩家累计消耗的平台币(只记录直充部分)
-
- -
后台发放平台币检测时间内玩家累计后台发放的平台币(只记录直充部分)
- -
后台发放平台币检测时间内玩家累计后台发放的平台币(只记录直充部分)
- -
后台发放平台币检测时间内玩家累计后台发放的平台币(只记录直充部分)
- -
后台发放平台币检测时间内玩家累计后台发放的平台币(只记录直充部分)
-
+ +
+ 当前平台币余额 + 当前用户平台币余额(不随搜索时间变化) +
+ + +
+ 平台币余额 + 检测时间最后一秒玩家留存的平台币 +
+ + +
+ 平台币直充支出 + 检测时间内玩家累计消耗的平台币(只记录直充部分) +
+ + +
+ 平台币直充金额 + 检测时间内玩家累计充值的平台币(只记录直充部分) +
+ + +
+ 后台发放平台币 + 检测时间内玩家累计后台发放的平台币(只记录直充部分) +
+ 操作 - + aOh! 暂时还没有内容! - + - {$data.user_id} - {$data.user_account} - {$data.after_value} - {$data.rest_value} - {$data.spend_amount} - {$data.deposit_amount} - {$data.coin_amount} + {$data.id} + {$data.account} + {$data.balance} + {$data.remain} + {$data.spend_value} + {$data.deposit_value} + {$data.promote_value} - 查看详情 + 查看详情 @@ -220,11 +181,11 @@ 汇总(检索时间内所有数据的统计) - {$banlaceTotal} - {$resttotal} - {$total} - {$deposit} - {$promoteCoin} + + + + + @@ -233,7 +194,7 @@
- 导出 + 导出 {$_page|default=''}
@@ -268,11 +229,17 @@ - From 268ea4e34d0ef9932949dac12270f005aca79b37 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Sun, 27 Sep 2020 18:28:47 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Addons/SiteStat/SiteStatAddon.class.php | 20 +-- Addons/SiteStat/info.html | 114 +++++++++++++++--- .../Admin/Controller/UserController.class.php | 17 +++ Application/Admin/View/Mend/edit.html | 2 +- .../Base/Service/AdminNoticeService.class.php | 82 +++++++++++++ .../Base/Service/PromoteService.class.php | 61 +++++++--- Data/update.sql | 23 ++++ 7 files changed, 280 insertions(+), 39 deletions(-) create mode 100644 Application/Base/Service/AdminNoticeService.class.php diff --git a/Addons/SiteStat/SiteStatAddon.class.php b/Addons/SiteStat/SiteStatAddon.class.php index 7fbb7c8d0..7f2ee956f 100644 --- a/Addons/SiteStat/SiteStatAddon.class.php +++ b/Addons/SiteStat/SiteStatAddon.class.php @@ -9,7 +9,7 @@ namespace Addons\SiteStat; use Common\Controller\Addon; - +use Base\Service\AdminNoticeService; /** * 系统环境信息插件 * @author thinkphp @@ -700,13 +700,19 @@ class SiteStatAddon extends Addon //$gift_list = array_merge($ty_gift,$new_gift_list); */ /* 2018-08-24 lwx add start */ - $gift_list = M('giftbag','tab_')->field('tab_giftbag.id,tab_giftbag.giftbag_name,tab_giftbag.server_id,tab_giftbag.server_name,tab_game.game_name') - - ->join('tab_game on (tab_game.id = tab_giftbag.game_id)','inner') - - ->where('LENGTH(tab_giftbag.novice)-LENGTH(REPLACE(tab_giftbag.novice, ",", ""))+1<10')->select(); - /* 2018-08-24 lwx add end */ + $gift_list = M('giftbag','tab_')->field('tab_giftbag.id,tab_giftbag.giftbag_name,tab_giftbag.server_id,tab_giftbag.server_name,tab_game.game_name') + + ->join('tab_game on (tab_game.id = tab_giftbag.game_id)','inner') + + ->where('LENGTH(tab_giftbag.novice)-LENGTH(REPLACE(tab_giftbag.novice, ",", ""))+1<10')->select(); + /* 2018-08-24 lwx add end */ + + $userAuth = session('user_auth'); + $adminNoticeService = new AdminNoticeService(); + $adminNoticeService->accept($userAuth['uid']); + $notices = $adminNoticeService->getAdminNotices($userAuth['uid']); + $this->assign('notices',$notices); $this->assign('gift_list',$gift_list); } diff --git a/Addons/SiteStat/info.html b/Addons/SiteStat/info.html index 8b4765f33..7334d2586 100644 --- a/Addons/SiteStat/info.html +++ b/Addons/SiteStat/info.html @@ -24,6 +24,28 @@ $(document).ready(function () { width: 60%; padding-left: 6%; } + .notice-btn { + display: inline-block; + /* width: 86px; */ + height: 22px; + line-height: 22px; + text-align: center; + vertical-align: middle; + color: #ffffff; + border: 1px solid currentColor; + border-radius: 3px; + margin-left: 5px; + padding: 0px 5px; + background-color: #18b1ea; + cursor: pointer; + } + .notice-btn.readed-btn { + color: #ffffff; + background-color: #a5b6c8; + } + .notice-btn.delete-notice-btn { + background-color: #f56c6c; + }
@@ -174,27 +196,48 @@ $(document).ready(function () { @@ -472,5 +515,42 @@ $(".js_indexSetup").click(function(){ content: ['{:U("Index/setup")}', 'no'], //iframe的url,no代表不显示滚动条 }); }); +$('.read-btn').on({ + click: function () { + var that = this + var id = $(this).parents('tr').eq(0).attr('data-id') + $.ajax({ + url: '{:U("User/readAdminNotice")}', + type: 'post', + dataType: 'json', + data: {id: id}, + success: function(result) { + if (result.status == 1) { + $(that).removeClass('read-btn').addClass('readed-btn').off('click') + $(that).html('已读') + } + layer.msg(result.info) + } + }) + } +}) +$('.delete-notice-btn').on({ + click: function () { + var that = this + var id = $(this).parents('tr').eq(0).attr('data-id') + $.ajax({ + url: '{:U("User/deleteAdminNotice")}', + type: 'post', + dataType: 'json', + data: {id: id}, + success: function(result) { + if (result.status == 1) { + $(that).parents('tr').eq(0).remove() + } + layer.msg(result.info) + } + }) + } +}) \ No newline at end of file diff --git a/Application/Admin/Controller/UserController.class.php b/Application/Admin/Controller/UserController.class.php index f20320617..9f4bcf646 100644 --- a/Application/Admin/Controller/UserController.class.php +++ b/Application/Admin/Controller/UserController.class.php @@ -12,6 +12,7 @@ namespace Admin\Controller; use User\Api\UserApi; use Com\Wechat; use Com\WechatAuth; +use Base\Service\AdminNoticeService; /** * 后台用户控制器 @@ -839,4 +840,20 @@ class UserController extends AdminController } return $this->ajaxReturn(array('status' => 1, 'data' => $lists)); } + + public function readAdminNotice() + { + $id = I('id', 0); + $service = new AdminNoticeService(); + $service->read($id); + $this->success('标记成功'); + } + + public function deleteAdminNotice() + { + $id = I('id', 0); + $service = new AdminNoticeService(); + $service->delete($id); + $this->success('删除成功'); + } } \ No newline at end of file diff --git a/Application/Admin/View/Mend/edit.html b/Application/Admin/View/Mend/edit.html index 022c92554..16f777fc6 100644 --- a/Application/Admin/View/Mend/edit.html +++ b/Application/Admin/View/Mend/edit.html @@ -76,7 +76,7 @@ - + diff --git a/Application/Base/Service/AdminNoticeService.class.php b/Application/Base/Service/AdminNoticeService.class.php new file mode 100644 index 000000000..666beb695 --- /dev/null +++ b/Application/Base/Service/AdminNoticeService.class.php @@ -0,0 +1,82 @@ +where([ + 'start_time' => ['elt', time()], + 'end_time' => ['egt', time()], + '_string' => 'concat(",", admin_ids, ",") like "%,' . $uid . ',%"' + ]) + ->getField('id', true); + if (empty($notices) || count($notices) == 0) { + return; + } + + $readNotices = M('admin_notice_read', 'tab_')->where(['admin_id' => $uid, 'notice_id' => ['in', $notices]])->getField('notice_id', true); + $unreadNotices = $readNotices ? array_diff($notices, $readNotices) : $notices; + + $records = []; + foreach ($unreadNotices as $noticeId) { + $records[] = [ + 'notice_id' => $noticeId, + 'admin_id' => $uid, + 'create_time' => time(), + 'update_time' => time() + ]; + } + M('admin_notice_read', 'tab_')->addAll($records); + } + + public function read($id) + { + M('admin_notice_read', 'tab_')->where(['id' => $id])->save(['status' => 1, 'update_time' => time()]); + } + + public function delete($id) + { + M('admin_notice_read', 'tab_')->where(['id' => $id])->save(['status' => 2, 'update_time' => time()]); + } + + public function getAdminNotices($uid) + { + $items = M('admin_notice_read', 'tab_')->field(['notice_id', 'status'])->where(['admin_id' => $uid, 'status' => ['in', [0, 1]]])->order('create_time desc')->select(); + if (empty($items) || count($items) == 0) { + return []; + } + $ids = array_column($items, 'notice_id'); + $notices = M('admin_notice','tab_') + ->where([ + 'id' => ['in', $ids], + 'start_time' => ['elt', time()], + 'end_time' => ['egt', time()], + ]) + ->select(); + + if ($notices) { + $notices = index_by_column('id', $notices); + } + + $records = []; + foreach ($items as $item) { + $notice = $notices[$item['notice_id']] ?? null; + if (is_null($notice)) { + continue; + } + $records[] = [ + 'id' => $item['notice_id'], + 'status' => $item['status'], + 'type' => $notice['type'], + 'content' => $notice['content'], + 'title' => $notice['title'], + 'target' => $notice['target'], + ]; + } + return $records; + } +} \ No newline at end of file diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index 5c640d99c..0972f13f9 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -321,9 +321,8 @@ class PromoteService { $toPromote = M('promote', 'tab_')->where(['id' => $toPromoteId])->find(); $fromPromote = M('promote', 'tab_')->where(['id' => $fromPromoteId])->find(); - $toPromote = $toPromote ?? ['id' => 0, 'account' => C('OFFICIEL_CHANNEL')]; - $fromPromote = $fromPromote ?? ['id' => 0, 'account' => C('OFFICIEL_CHANNEL')]; - + $toPromote = $toPromote ?? ['id' => 0, 'account' => C('OFFICIEL_CHANNEL'), 'company_id' => 0]; + $fromPromote = $fromPromote ?? ['id' => 0, 'account' => C('OFFICIEL_CHANNEL'), 'company_id' => 0]; if ($fromPromote['id'] == 0 && count($shiftIds) == 0) { return ['status' => false, 'msg' => '官方渠道玩家不能全部迁移']; @@ -339,14 +338,26 @@ class PromoteService { $users = M('user', 'tab_')->field(['id', 'account', 'nickname'])->where($map)->select(); $spendMap['pay_time'] = ['egt', $orderTime]; + $spendMap['is_check'] = ['in','1,2']; + $spendMap['settle_check'] = 0; + $spendMap['selle_status'] = 0; + $spendMap['pay_status'] = 1; + $payAmountRows = M('spend', 'tab_') - ->field(['user_id', 'sum(pay_amount) payAmount']) + ->field(['user_id', 'sum(pay_amount) pay_amount']) ->where($spendMap) + ->group('user_id') ->select(); $payAmountRows = index_by_column('user_id', $payAmountRows); + $users = index_by_column('id', $users); + $notices = []; + $formConpany = M('promote_company', 'tab_')->field(['company_name', 'company_belong'])->where(['id' => $fromPromote['company_id']])->find(); + $toConpany = M('promote_company', 'tab_')->field(['company_name', 'company_belong'])->where(['id' => $toPromote['company_id']])->find(); + $belongs = PromoteCompanyService::$belongs; $mends = []; foreach ($users as $item) { + $amount = isset($payAmountRows[$item['id']]) ? round(floatval($payAmountRows[$item['id']]['pay_amount']), 2) : 0; $mends[] = [ 'user_id' => $item['id'], 'user_account' => $item['account'], @@ -358,12 +369,28 @@ class PromoteService { 'remark' => $remark == '' ? ($task['creator_type'] == 0 ? '后台补链' : '玩家迁移') : $remark, 'order_time' => $orderTime, 'create_time' => time(), - 'pay_amount' => isset($payAmountRows[$item['id']]) ? intval($payAmountRows[$item['id']]['payAmount']) : 0, + 'pay_amount' => $amount, 'op_id' => $creator ? $creator['id'] : 0, 'op_account' => $opAccount, 'op_type' => $task['creator_type'], 'bind_type' => 1, ]; + if ($amount > 500) { + $userWord = '玩家账号' . $item['account']; + $fromWord = $fromPromote['account'] . ($formConpany ? '(' . $belongs[$formConpany['company_belong']] . '-' . $formConpany['company_name'] : ''); + $toWord = $toPromote['account'] . ($toConpany ? '(' . $belongs[$toConpany['company_belong']] . '-' . $toConpany['company_name'] : ''); + $content = $userWord . ', 从' . $fromWord . '换绑到' . $toWord . ',换绑金额超过500,达到' . $amount . '元'; + $notices[] = [ + 'type' => 'shift-player', + 'title' => '换绑额度超500', + 'content' => $content, + 'admin_ids' => '1', + 'create_time' => time(), + 'target' => $item['account'], + 'start_time' => time(), + 'end_time' => time() + 7*24*3600, + ]; + } } $model = new Model(); @@ -375,6 +402,10 @@ class PromoteService { return ['status' => false, 'msg' => '系统异常,添加变更记录失败']; } + if (count($notices) > 0) { + M('admin_notice', 'tab_')->addAll($notices); + } + $updateData = [ 'promote_id' => $toPromote['id'], 'promote_account' => $toPromote['account'] @@ -398,15 +429,17 @@ class PromoteService { M('user_play', 'tab_')->where($otherMap)->save($updateData); M('user_play_info', 'tab_')->where($otherMap)->save($updateData); - $orderMap1 = $otherMap; - $orderMap1['pay_time'] = ['egt', $orderTime]; - M('spend', 'tab_')->where($orderMap1)->where(['is_check' => ['in','1,2'], 'settle_check' => 0, 'selle_status' => 0])->save(array_merge($updateData, $updateMarket)); // 只改未对账的数据 - M('bind_spend', 'tab_')->where($orderMap1)->save($updateData); - - $orderMap2 = $otherMap; - $orderMap2['create_time'] = ['egt', $orderTime]; - M('deposit', 'tab_')->where($orderMap2)->save(array_merge($updateData, $updateMarket)); - M('user_play_data_count', 'tab_')->where($orderMap2)->save(['promote_id' => $toPromote['id']]); + unset($spendMap['pay_status']); + M('spend', 'tab_')->where($spendMap)->save(array_merge($updateData, $updateMarket)); // 只改未对账的数据 + + $bindMap = $otherMap; + $bindMap['pay_time'] = ['egt', $orderTime]; + M('bind_spend', 'tab_')->where($bindMap)->save($updateData); + + $orderMap = $otherMap; + $orderMap['create_time'] = ['egt', $orderTime]; + M('deposit', 'tab_')->where($orderMap)->save(array_merge($updateData, $updateMarket)); + M('user_play_data_count', 'tab_')->where($orderMap)->save(['promote_id' => $toPromote['id']]); $status = M('shift_task', 'sys_')->where('id=' . $task['id'])->save(['status' => 1, 'handle_time' => time()]); if (!$status) { diff --git a/Data/update.sql b/Data/update.sql index e98d14d62..70d21dfeb 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -2512,4 +2512,27 @@ CREATE TABLE `tab_payment_orders` ( `created_at` datetime NOT NULL COMMENT '订单创建时间', `finished_at` datetime NOT NULL COMMENT '订单完成时间', PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `tab_admin_notice` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `type` varchar(20) NOT NULL COMMENT '提示类型', + `title` varchar(32) NOT NULL COMMENT '标题', + `content` varchar(255) NOT NULL COMMENT '内容', + `admin_ids` varchar(255) NOT NULL DEFAULT '' COMMENT '接收管理员ID', + `target` varchar(255) NOT NULL DEFAULT '' COMMENT '对应标识', + `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `start_time` int(11) NOT NULL DEFAULT '0' COMMENT '展示开始时间', + `end_time` int(11) NOT NULL DEFAULT '0' COMMENT '展示结束时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `tab_admin_notice_read` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `notice_id` int(11) NOT NULL COMMENT '通知ID', + `admin_id` int(11) NOT NULL COMMENT '管理员ID', + `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', + `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态 0 未读 1 已读', + PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file From ce1d061ee6573e34f09533d424bb25725a223ef2 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Sun, 27 Sep 2020 18:31:51 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/BaseController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Home/Controller/BaseController.class.php b/Application/Home/Controller/BaseController.class.php index fae35173b..fa192f705 100644 --- a/Application/Home/Controller/BaseController.class.php +++ b/Application/Home/Controller/BaseController.class.php @@ -395,7 +395,7 @@ class BaseController extends HomeController /** * 市场部特殊推广公司的规则 */ - $onlyPresidentList = [330, 331, 332]; + $onlyPresidentList = [330, 331, 332, 334]; if (in_array($topPromote['company_id'], $onlyPresidentList)) { if ($topPromote['can_view_recharge'] == 1 && $promote['level'] == 1) { return true; From 2f4868553a1f79da8695c42a0d00aa4e5e729b58 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Sun, 27 Sep 2020 19:01:16 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/BaseController.class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Application/Home/Controller/BaseController.class.php b/Application/Home/Controller/BaseController.class.php index fa192f705..ea09d5dc0 100644 --- a/Application/Home/Controller/BaseController.class.php +++ b/Application/Home/Controller/BaseController.class.php @@ -395,7 +395,7 @@ class BaseController extends HomeController /** * 市场部特殊推广公司的规则 */ - $onlyPresidentList = [330, 331, 332, 334]; + $onlyPresidentList = [330, 331, 332]; if (in_array($topPromote['company_id'], $onlyPresidentList)) { if ($topPromote['can_view_recharge'] == 1 && $promote['level'] == 1) { return true; @@ -404,6 +404,15 @@ class BaseController extends HomeController } } + $closePromoteLowest = [334]; + if (in_array($topPromote['company_id'], $closePromoteLowest)) { + if ($topPromote['can_view_recharge'] == 1 && $promote['level'] != 4) { + return true; + } else { + return false; + } + } + if ($topPromote['can_view_recharge'] == 1) { return true; } From 0ebaf6ed64abd5d9715d57917113c2392c1f4e5f Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 28 Sep 2020 11:39:44 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E5=B0=8Fbug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/MarketPercentageController.class.php | 4 ++-- .../Admin/Controller/PresidentDepositController.class.php | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Application/Admin/Controller/MarketPercentageController.class.php b/Application/Admin/Controller/MarketPercentageController.class.php index f4c4f29c9..e68cc9961 100644 --- a/Application/Admin/Controller/MarketPercentageController.class.php +++ b/Application/Admin/Controller/MarketPercentageController.class.php @@ -141,7 +141,7 @@ class MarketPercentageController extends ThinkController if ($_REQUEST['export']) { $title = ['pay_time' => '时间', - 'company_name'=>'推广公司', + 'company_name'=>'公司名称', 'promote_account' => '会长账号', 'company_belong' => '内外团', 'real_name' => '所属市场专员', @@ -524,7 +524,7 @@ class MarketPercentageController extends ThinkController if ($_REQUEST['export']) { $title = ['pay_time' => '时间', - 'real_name' => '市场人员', + 'real_name' => '市场专员', 'level' => '级别', 'performance_revenue' => '开发总流水', 'appraisal_bonuses' => '维护总流水', diff --git a/Application/Admin/Controller/PresidentDepositController.class.php b/Application/Admin/Controller/PresidentDepositController.class.php index d797c5288..9720c4ed5 100644 --- a/Application/Admin/Controller/PresidentDepositController.class.php +++ b/Application/Admin/Controller/PresidentDepositController.class.php @@ -81,11 +81,13 @@ class PresidentDepositController extends ThinkController $subSql = M('president_deposit', 'tab_')->field('company_id')->where($depositWhere)->select(false); $where['_string'] .= ' and id in (' . $subSql . ')'; + $query = M('promote_company', 'tab_'); + if (!empty(I('admin_id', 0))) { - $query->where(['admin_id' => I('admin_id', 0)]); + $query->where(['uid' => I('admin_id', 0)]); } - $query = M('promote_company', 'tab_')->where($where); + $query = $query->where($where); $count = 0; $totalQuery = clone $query; From f757c10c610171a3bdd16afd7925c8202f4a52b0 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 28 Sep 2020 13:49:09 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E7=BB=91=E5=AE=9A=E5=85=AC=E5=8F=B8?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/AggregateRelationController.class.php | 3 ++- Data/update.sql | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/AggregateRelationController.class.php b/Application/Admin/Controller/AggregateRelationController.class.php index fdc140a1e..01464363e 100644 --- a/Application/Admin/Controller/AggregateRelationController.class.php +++ b/Application/Admin/Controller/AggregateRelationController.class.php @@ -699,12 +699,13 @@ class AggregateRelationController extends AdminController $mentBtn = [ "addRelation"=>"新增公司绑定" ]; + $resarr = []; foreach ($mentBtn as $k => $v) { if(IS_ROOT){ $resarr[] = $v; }else{ - if(in_array($k,$this->OpAuthList)){ + if(in_array('Admin/aggregateRelation/'.$k,$this->OpAuthList)){ $resarr[] = $v; } } diff --git a/Data/update.sql b/Data/update.sql index 200f13b31..37508fdaa 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -2626,4 +2626,6 @@ CREATE TABLE `tab_aggregate_statement_pool` ( ALTER TABLE `tab_company_info` ADD COLUMN `invoice_item` varchar(255) NULL DEFAULT '' COMMENT '开票内容' AFTER `fax_ratio`, -ADD COLUMN `invoice_type` varchar(255) NULL DEFAULT '' COMMENT '开票类型' AFTER `invoice_item`; \ No newline at end of file +ADD COLUMN `invoice_type` varchar(255) NULL DEFAULT '' COMMENT '开票类型' AFTER `invoice_item`, +ADD COLUMN `register_phone` varchar(24) NULL DEFAULT '' COMMENT '注册电话' AFTER `invoice_type`, +ADD COLUMN `register_address` varchar(255) NULL DEFAULT '' COMMENT '注册地址' AFTER `register_phone`; \ No newline at end of file From f4f822d31adeee30bd166cecfa4e94df08420fcc Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 28 Sep 2020 14:05:29 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E5=85=AC=E5=8F=B8=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/AggregateRelationController.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/AggregateRelationController.class.php b/Application/Admin/Controller/AggregateRelationController.class.php index 01464363e..8d0346fd7 100644 --- a/Application/Admin/Controller/AggregateRelationController.class.php +++ b/Application/Admin/Controller/AggregateRelationController.class.php @@ -678,7 +678,8 @@ class AggregateRelationController extends AdminController * @return void */ protected function getBindCompanyId($type){ - $dbres = M("CompanyRelation","tab_")->where("first_company_type = {$type} OR second_company_type = {$type}")->field("first_company_id,second_company_id")->select(); + $dbres = M("CompanyRelation","tab_")->where("first_company_type = {$type} OR second_company_type = {$type}")->field("first_company_id,second_company_id,first_company_type,second_company_type")->select(); + if(empty($dbres)){ return false; }else{ @@ -690,6 +691,7 @@ class AggregateRelationController extends AdminController $sendid[] = $v['second_company_id']; } } + return implode(",",$sendid); } } From 6b486331b5e925b79e9075671137d3d571bb6ad2 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 28 Sep 2020 15:14:54 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E6=B1=87=E6=80=BB=E6=9D=83=E9=99=90?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/AggregateRelationController.class.php | 4 ++-- .../Controller/AggregateStatementLackController.class.php | 5 +++-- .../Controller/AggregateStatementPoolController.class.php | 7 ++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Application/Admin/Controller/AggregateRelationController.class.php b/Application/Admin/Controller/AggregateRelationController.class.php index 8d0346fd7..c627e132a 100644 --- a/Application/Admin/Controller/AggregateRelationController.class.php +++ b/Application/Admin/Controller/AggregateRelationController.class.php @@ -728,7 +728,7 @@ class AggregateRelationController extends AdminController if(IS_ROOT){ $resarr[] = $opBtn[$v]; }else{ - if(in_array($v,$this->OpAuthList)){ + if(in_array('Admin/aggregateRelation/'.$v,$this->OpAuthList)){ $resarr[] = $opBtn[$v]; } } @@ -750,7 +750,7 @@ class AggregateRelationController extends AdminController if(IS_ROOT){ $resarr[] = $v; }else{ - if(in_array($k,$this->OpAuthList)){ + if(in_array('Admin/aggregateRelation/'.$k,$this->OpAuthList)){ $resarr[] = $v; } } diff --git a/Application/Admin/Controller/AggregateStatementLackController.class.php b/Application/Admin/Controller/AggregateStatementLackController.class.php index 2f8ac5645..554e2b790 100644 --- a/Application/Admin/Controller/AggregateStatementLackController.class.php +++ b/Application/Admin/Controller/AggregateStatementLackController.class.php @@ -33,6 +33,7 @@ class AggregateStatementLackController extends ThinkController if(!IS_ROOT){ $this->OpAuthList= getModuleControllerAuth(); } +// dump($this->OpAuthList);die(); $this->assign('menubtn',$this->menuAuth()); $map = [ @@ -350,7 +351,7 @@ class AggregateStatementLackController extends ThinkController if(IS_ROOT){ $resarr[] = $opBtn[$v]; }else{ - if(in_array($v,$this->OpAuthList)){ + if(in_array("Admin/aggregateStatementLack/".$v,$this->OpAuthList)){ $resarr[] = $opBtn[$v]; } } @@ -368,7 +369,7 @@ class AggregateStatementLackController extends ThinkController if(IS_ROOT){ $resarr[] = $v; }else{ - if(in_array($k,$this->OpAuthList)){ + if(in_array("Admin/aggregateStatementLack/".$k,$this->OpAuthList)){ $resarr[] = $v; } } diff --git a/Application/Admin/Controller/AggregateStatementPoolController.class.php b/Application/Admin/Controller/AggregateStatementPoolController.class.php index c8a7b9942..10ce92cf5 100644 --- a/Application/Admin/Controller/AggregateStatementPoolController.class.php +++ b/Application/Admin/Controller/AggregateStatementPoolController.class.php @@ -921,6 +921,7 @@ class AggregateStatementPoolController extends ThinkController default: break; } + $optist = ["viewPool","cancelPool"]; // if($info['platform_amount'] <= 0 && $info['company_type'] != 2){ @@ -942,7 +943,7 @@ class AggregateStatementPoolController extends ThinkController }else{ $optist = array_diff($optist, ["cancelPool","reCount"]); } - + if(empty($info['ext_file'])){ //未上传凭证 $optist = array_diff($optist, ["viewVoucher", "editVoucher"]); @@ -969,7 +970,7 @@ class AggregateStatementPoolController extends ThinkController if(IS_ROOT){ $resarr[] = $opBtn[$v]; }else{ - if(in_array($v,$this->OpAuthList)){ + if(in_array("Admin/aggregateStatementPool/".$v,$this->OpAuthList)){ $resarr[] = $opBtn[$v]; } } @@ -988,7 +989,7 @@ class AggregateStatementPoolController extends ThinkController if(IS_ROOT){ $resarr[] = $v; }else{ - if(in_array($k,$this->OpAuthList)){ + if(in_array("Admin/aggregateStatementPool/".$k,$this->OpAuthList)){ $resarr[] = $v; } } From 0dd7bceb3f2a8f7416836126870fa7938f9aa7d1 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Tue, 29 Sep 2020 09:18:24 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E7=89=B9=E6=AE=8A=E6=AF=94=E4=BE=8Bbug?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/View/CompanyGameRatio/export.html | 72 ++++++++++++++----- 1 file changed, 56 insertions(+), 16 deletions(-) diff --git a/Application/Admin/View/CompanyGameRatio/export.html b/Application/Admin/View/CompanyGameRatio/export.html index 6e2ecd4fd..771421bb2 100644 --- a/Application/Admin/View/CompanyGameRatio/export.html +++ b/Application/Admin/View/CompanyGameRatio/export.html @@ -53,25 +53,65 @@ {$data.game_type_name} {$data.original_package_name} {$data.relation_game_name} - {$data.valid} - - {$data['turnover_ratio'][0]['name']|default="--"} - {$data['turnover_ratio'][0]['ratio']|showPercent} - + + {$data['valid'][0]} + -- + + + {$data['turnover_ratios'][0][0]['name']|default="--"} + {$data['turnover_ratios'][0][0]['ratio']|showPercent} + -- - + -- + + - - - - - {$game_ratio['name']|default="--"} - {$game_ratio['ratio']|showPercent} - - - - + + + + + {$valid|default="--"} + {$data['turnover_ratios'][$keys][0]['name']|default="--"} + {$data['turnover_ratios'][$keys][0]['ratio']|showPercent} + + + {$vo} + + + + + + + {$game_ratio['name']|default="--"} + {$game_ratio['ratio']|showPercent} + + + + + + + + {$game_ratio['name']|default="--"} + {$game_ratio['ratio']|showPercent} + + + + + + + + + + + + + + + + + + From a977cf5f312d978abd9158089105a5161529cb4b Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Tue, 29 Sep 2020 10:02:18 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E8=81=9A=E5=90=88=E5=85=AC=E5=8F=B8?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/AggregateRelationController.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Application/Admin/Controller/AggregateRelationController.class.php b/Application/Admin/Controller/AggregateRelationController.class.php index c627e132a..010e2d504 100644 --- a/Application/Admin/Controller/AggregateRelationController.class.php +++ b/Application/Admin/Controller/AggregateRelationController.class.php @@ -121,7 +121,6 @@ class AggregateRelationController extends AdminController "settlement_type"=>"结算周期", "invoice_type"=>"开票类型", "invoice_content"=>"开票内容", - "is_payment"=>"打款流程", "collection"=>"收款方" )); } From ca99068a0ee8f79b56c05a99861947267b86de9a Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Tue, 29 Sep 2020 10:23:48 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Base/Service/PromoteService.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index 0972f13f9..e40bf47e9 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -384,7 +384,7 @@ class PromoteService { 'type' => 'shift-player', 'title' => '换绑额度超500', 'content' => $content, - 'admin_ids' => '1', + 'admin_ids' => '31', 'create_time' => time(), 'target' => $item['account'], 'start_time' => time(), From a2b085562d791485bc18e8f1c4aeec4cd13133b4 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Wed, 30 Sep 2020 11:26:31 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E8=81=9A=E5=90=88=E6=B1=87=E6=80=BBbug?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AggregateRelationController.class.php | 9 ++++--- .../View/AggregateFinanceStatement/lists.html | 2 +- .../Admin/View/AggregateRelation/lists.html | 26 +++++++++---------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Application/Admin/Controller/AggregateRelationController.class.php b/Application/Admin/Controller/AggregateRelationController.class.php index 010e2d504..a94f0fea4 100644 --- a/Application/Admin/Controller/AggregateRelationController.class.php +++ b/Application/Admin/Controller/AggregateRelationController.class.php @@ -299,7 +299,7 @@ class AggregateRelationController extends AdminController $dbres = $this->DBlogModel->field("id,status,verify_log")->where("id in ({$ids})")->select(); foreach($dbres as $k=>&$v){ if($v['status'] != 1) continue; - $v['verify_log'] = json_decode($v['verify_log'],true); +// $v['verify_log'] = json_decode($v['verify_log'],true); $v['verify_log']['admin_user']=$this->admininfo["username"]; $v['verify_log']['admin_time']=date("Y-m-d H:i:s"); $v['verify_log'] = json_encode($v['verify_log']); @@ -317,8 +317,9 @@ class AggregateRelationController extends AdminController if(!isset($_REQUEST['ids'])) $this->error("参数错误"); $ids = $_REQUEST['ids']; $dbres = $this->DBlogModel->field("*")->where("id in ({$ids})")->select(); + foreach($dbres as $k=>&$v){ - if($v['status'] != 1) continue; + if($v['status'] != 1 && $v['status'] != 0) continue; $v['verify_log'] = json_decode($v['verify_log'],true); $v['verify_log']['admin_user']=$this->admininfo["username"]; $v['verify_log']['admin_time']=date("Y-m-d H:i:s"); @@ -739,8 +740,8 @@ class AggregateRelationController extends AdminController { $mentBtn = [ - "marketAgree"=>"市场部审批通过", - "marketRefuse"=>"市场部审核拒绝", +// "marketAgree"=>"市场部审批通过", +// "marketRefuse"=>"市场部审核拒绝", "adminAgree"=>"管理员审核通过", "adminRefuse"=>"管理员审核拒绝" ]; diff --git a/Application/Admin/View/AggregateFinanceStatement/lists.html b/Application/Admin/View/AggregateFinanceStatement/lists.html index e5ae3599a..43f80cc77 100644 --- a/Application/Admin/View/AggregateFinanceStatement/lists.html +++ b/Application/Admin/View/AggregateFinanceStatement/lists.html @@ -445,7 +445,7 @@ //重算金额 $("#updateStatement").on("click",function(){ var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { - if($(elem).data("status") == 0 || $(elem).data("status") == 1 || $(elem).data("status") == -1){ + if($(elem).data("status") == 0 || $(elem).data("status") == 1 || $(elem).data("status") == -1 || $(elem).data("status") == -3){ return $(elem).val(); }else{ flag = true; diff --git a/Application/Admin/View/AggregateRelation/lists.html b/Application/Admin/View/AggregateRelation/lists.html index 1aef9b512..ea253b666 100644 --- a/Application/Admin/View/AggregateRelation/lists.html +++ b/Application/Admin/View/AggregateRelation/lists.html @@ -150,7 +150,7 @@ 开票内容 收款方 创建记录 - 市场部审批 + 管理员审批 备注 操作 @@ -182,17 +182,17 @@ {$data.create}
- - -
- {$data.market} -
- -
- {$data.market} -
-
- + + + + + + + + + + +
@@ -341,7 +341,7 @@ $(function(){ var flag = false; var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { - if($(elem).data("status") != status){ + if($(elem).data("status") != 0 && $(elem).data("status") != 1 ){ flag = true; }else{ return $(elem).val(); From 7d3c8ebd61e7119d9a4c6546524df12b84a37606 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Wed, 30 Sep 2020 11:36:49 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E6=8B=92=E7=BB=9Dbug?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/AggregateRelationController.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/AggregateRelationController.class.php b/Application/Admin/Controller/AggregateRelationController.class.php index a94f0fea4..7cd7c8a5a 100644 --- a/Application/Admin/Controller/AggregateRelationController.class.php +++ b/Application/Admin/Controller/AggregateRelationController.class.php @@ -298,8 +298,8 @@ class AggregateRelationController extends AdminController $ids = $_REQUEST['ids']; $dbres = $this->DBlogModel->field("id,status,verify_log")->where("id in ({$ids})")->select(); foreach($dbres as $k=>&$v){ - if($v['status'] != 1) continue; -// $v['verify_log'] = json_decode($v['verify_log'],true); + if($v['status'] != 1 && $v['status'] != 0) continue; + $v['verify_log'] = json_decode($v['verify_log'],true); $v['verify_log']['admin_user']=$this->admininfo["username"]; $v['verify_log']['admin_time']=date("Y-m-d H:i:s"); $v['verify_log'] = json_encode($v['verify_log']);