diff --git a/Application/Admin/Controller/CompanyStatementController.class.php b/Application/Admin/Controller/CompanyStatementController.class.php index 50b4181f6..a1d961da1 100644 --- a/Application/Admin/Controller/CompanyStatementController.class.php +++ b/Application/Admin/Controller/CompanyStatementController.class.php @@ -649,18 +649,18 @@ class CompanyStatementController extends ThinkController ->select(); $use_data = [ - "01"=>["time"=>"01","show_company_name"=>$data[0]["company_name"],"row"=>1], - "02"=>["time"=>"02","show_company_name"=>$data[0]["company_name"],"row"=>1], - "03"=>["time"=>"03","show_company_name"=>$data[0]["company_name"],"row"=>1], - "04"=>["time"=>"04","show_company_name"=>$data[0]["company_name"],"row"=>1], - "05"=>["time"=>"05","show_company_name"=>$data[0]["company_name"],"row"=>1], - "06"=>["time"=>"06","show_company_name"=>$data[0]["company_name"],"row"=>1], - "07"=>["time"=>"07","show_company_name"=>$data[0]["company_name"],"row"=>1], - "08"=>["time"=>"08","show_company_name"=>$data[0]["company_name"],"row"=>1], - "09"=>["time"=>"09","show_company_name"=>$data[0]["company_name"],"row"=>1], - "10"=>["time"=>"10","show_company_name"=>$data[0]["company_name"],"row"=>1], - "11"=>["time"=>"11","show_company_name"=>$data[0]["company_name"],"row"=>1], - "12"=>["time"=>"12","show_company_name"=>$data[0]["company_name"],"row"=>1], + "01"=>["time"=>"01","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.01.01','statement_end_time'=>$time.'.01.'.date('t',strtotime($time.'01'))]]], + "02"=>["time"=>"02","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.02.01','statement_end_time'=>$time.'.02.'.date('t',strtotime($time.'02'))]]], + "03"=>["time"=>"03","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.03.01','statement_end_time'=>$time.'.03.'.date('t',strtotime($time.'03'))]]], + "04"=>["time"=>"04","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.04.01','statement_end_time'=>$time.'.04.'.date('t',strtotime($time.'04'))]]], + "05"=>["time"=>"05","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.05.01','statement_end_time'=>$time.'.05.'.date('t',strtotime($time.'05'))]]], + "06"=>["time"=>"06","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.06.01','statement_end_time'=>$time.'.06.'.date('t',strtotime($time.'06'))]]], + "07"=>["time"=>"07","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.07.01','statement_end_time'=>$time.'.07.'.date('t',strtotime($time.'07'))]]], + "08"=>["time"=>"08","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.08.01','statement_end_time'=>$time.'.08.'.date('t',strtotime($time.'08'))]]], + "09"=>["time"=>"09","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.09.01','statement_end_time'=>$time.'.09.'.date('t',strtotime($time.'09'))]]], + "10"=>["time"=>"10","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.10.01','statement_end_time'=>$time.'.10.'.date('t',strtotime($time.'10'))]]], + "11"=>["time"=>"11","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.11.01','statement_end_time'=>$time.'.11.'.date('t',strtotime($time.'11'))]]], + "12"=>["time"=>"12","show_company_name"=>$data[0]["company_name"],"row"=>1,"withdraw_type"=>$data[0]["withdraw_type"],"statement_info"=>[['statement_begin_time'=>$time.'.12.01','statement_end_time'=>$time.'.12.'.date('t',strtotime($time.'12'))]]], ]; $row = 0; @@ -681,8 +681,9 @@ class CompanyStatementController extends ThinkController $real_statement_amount = number_format($v['platform_money']*(1-$v['promote_ratio']/100)*($v['ratio']/100)*(1-$v["fax_ratio"]/100),2,'.','');; - - $statement_info[$k]['other_amount'] = number_format($v["sum_money"] - $real_statement_amount,2,'.',''); + if (!$statement_info[$k]['other_amount']) { + $statement_info[$k]['other_amount'] = number_format($v["sum_money"] - $real_statement_amount,2,'.',''); + } $sum[$ckey]["ratio"] += $v["ratio"]; $sum[$ckey]["promote_ratio"] += $v["promote_ratio"]; @@ -725,10 +726,14 @@ class CompanyStatementController extends ThinkController $assign_data[] = array_values($use_data); } - +// dump($assign_data); foreach ($assign_data as $key => $value) { foreach ($value as $k => $v) { - $assign_data[$key][$k]["row"] = count($v["statement_info"])?count($v["statement_info"]):1; + if (count($v["statement_info"]) > 1) { + unset($assign_data[$key][$k]['statement_info'][0]); + $assign_data[$key][$k]['statement_info'] = array_values($assign_data[$key][$k]['statement_info']); + } + $assign_data[$key][$k]["row"] = count($assign_data[$key][$k]["statement_info"])?count($assign_data[$key][$k]["statement_info"]):1; } } diff --git a/Application/Admin/Controller/MarketPercentageController.class.php b/Application/Admin/Controller/MarketPercentageController.class.php index fdd4be162..0c161cba5 100644 --- a/Application/Admin/Controller/MarketPercentageController.class.php +++ b/Application/Admin/Controller/MarketPercentageController.class.php @@ -828,19 +828,23 @@ class MarketPercentageController extends ThinkController $value['company_profit'] = "0.00"; } // - $data[$key]['should_performance_commission'] = substr(number_format($value["performance_commission"] * ($market_percentage["performance_monthly_ratio"]/100), 4, '.', ''),0,-2)+$this->returnMarketPercentageArray[$value['admin_id'].$value['pay_time']]['performance_commission']; - $data[$key]['should_month_bonus_ratio'] = substr(number_format($value["achievement_bonus"] * ($market_percentage["month_bonus_ratio"]/100), 4, '.', ''),0,-2) + $this->returnMarketPercentageArray[$value['admin_id'].$value['pay_time']]['achievement_bonus']; + $data[$key]['should_performance_commission'] = number_format($value["performance_commission"] * ($market_percentage["performance_monthly_ratio"]/100), 2, '.', '')+$this->returnMarketPercentageArray[$value['admin_id'].$value['pay_time']]['performance_commission']; $data[$key]['extend_commission'] += $this->returnMarketPercentageArray[$value['admin_id'].$value['pay_time']]['performance_commission']+$this->returnMarketPercentageArray[$value['admin_id'].$value['pay_time']]['achievement_bonus']; + $data[$key]['extend_commission'] = number_format($data[$key]['extend_commission'], 2, '.', ''); + $data[$key]['should_month_bonus_ratio'] = $data[$key]['extend_commission'] - $data[$key]['should_performance_commission']; // dump($this->returnMarketPercentageArray[$value['admin_id'].$value['pay_time']]['performance_commission']); // dump($this->returnMarketPercentageArray[$value['admin_id'].$value['pay_time']]['achievement_bonus']); // $data[$key]['wait_commission'] += $this->returnWaitMarketPercentageArray[$value['admin_id'].$value['pay_time']]['performance_commission']+$this->returnWaitMarketPercentageArray[$value['admin_id'].$value['pay_time']]['achievement_bonus']; - $data[$key]['extend_commission'] = number_format($data[$key]['extend_commission'], 2, '.', ''); + $data[$key]['wait_commission'] = number_format($data[$key]['wait_commission'], 2, '.', ''); + + $data[$key]['wait_achievement_commission'] = $data[$key]['wait_commission'] - $data[$key]['wait_performance_commission']; + $data[$key]['achievement_bonus'] = $achievement_bonus; $sum['performance_revenue'] += $data[$key]['performance_revenue']; diff --git a/Application/Admin/Controller/SocietyInfoController.class.php b/Application/Admin/Controller/SocietyInfoController.class.php index 4423d2a57..a1167be06 100644 --- a/Application/Admin/Controller/SocietyInfoController.class.php +++ b/Application/Admin/Controller/SocietyInfoController.class.php @@ -71,14 +71,39 @@ class SocietyInfoController extends ThinkController $map['communication_time'] = array('elt', time() - $gap * 86400); } if (I('sociaty_level') && I('sociaty_level') != '0') $map['sociaty_level'] = I('sociaty_level'); + //获取分页数据 $query = $model->where($map)->order("communication_time desc"); $count = $query->count(); + if($_REQUEST['ids'] && $is_export) { + $map['id'] = ['in',$_REQUEST['ids']]; + } + $order_query = $query + ->where($map); + + if (I('data_order')) { + $data_order = reset(explode(',', $_REQUEST['data_order'])); + $data_order_type = end(explode(',', $_REQUEST['data_order'])); + + if ($data_order == 4 && $data_order_type == "create_time") { + $order_query = $order_query->order("create_time desc"); + } else if($data_order == 3 && $data_order_type == "create_time") { + $order_query = $order_query->order("create_time asc"); + } + + if ($data_order == 4 && $data_order_type == "communication_time") { + $order_query = $order_query->order("communication_time desc"); + } else if($data_order == 3 && $data_order_type == "communication_time") { + $order_query = $order_query->order("communication_time asc"); + } + + $this->assign('userarpu_order', $data_order); + $this->assign('userarpu_order_type', $data_order_type); + } + if($is_export){ $map['id'] = ['in',$_REQUEST['ids']]; - $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("communication_time desc") + $parseData = $order_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") ->select(); foreach ($parseData as &$v) { $v['sociaty_level'] = $this->level[$v['sociaty_level']]; @@ -96,7 +121,7 @@ class SocietyInfoController extends ThinkController $this->export($head, $parseData, "公会信息-".date('Ymd')); return ; } else { - $societyInfos = $model->where($map)->order("communication_time desc")->field("*")->page($page,$row)->select(); + $societyInfos = $order_query->page($page,$row)->field("*")->select(); // dump($societyInfos);die(); } diff --git a/Application/Admin/Controller/TestingResourceController.class.php b/Application/Admin/Controller/TestingResourceController.class.php index 882a80204..1668dc596 100644 --- a/Application/Admin/Controller/TestingResourceController.class.php +++ b/Application/Admin/Controller/TestingResourceController.class.php @@ -9,6 +9,7 @@ use Base\Service\TestingResourceService; use Base\Service\PartnerService; use Base\Repository\TestingResourceRepository; use Base\Repository\GameRepository; +use Base\Service\GameService; class TestingResourceController extends ThinkController { @@ -439,11 +440,21 @@ class TestingResourceController extends ThinkController $bindingRole = null; if ($role) { $servers = M('server', 'tab_')->field('id,server_name,server_id')->where(['game_id' => $role['game_id']])->order('server_id asc')->select(); + $game = M('game', 'tab_')->where(['id' => $role['game_id']])->find(['id', 'data_share']); $binding = M('testing_binding', 'tab_')->where(['game_id' => $role['game_id'], 'role_id' => $role['role_id']])->find(); if ($binding) { + + $gameIds = [$role['game_id']]; + if ($game['data_share'] == 1) { + $gameRepository = new GameRepository(); + $baseGames = $gameRepository->getBaseGames(); + $baseGame = $gameRepository->getBaseGameByGameId($role['game_id'], $baseGames); + $gameIds = $gameRepository->getGameIdsByBaseGame($baseGame); + } + $bindingRole = M('user_play_info', 'tab_') ->field(['id', 'role_id', 'user_id', 'game_id', 'server_id', 'user_account', 'role_name']) - ->where(['game_id' => $binding['game_id'], 'role_id' => $binding['bind_role_id']]) + ->where(['game_id' => ['in', $gameIds], 'role_id' => $binding['bind_role_id']]) ->find(); if ($bindingRole) { $bindingRole['binding_time'] = $binding['create_time']; @@ -574,34 +585,17 @@ class TestingResourceController extends ThinkController $otherQuota = I('other_quota', 0); $otherQuotaRemark = I('otherQuotaRemark', ''); M('user_play_info', 'tab_')->where(['id' => $id])->save(['testing_other_quota' => $otherQuota,'testing_other_quota_remark' => $otherQuotaRemark]); + $admin_account = $_SESSION['onethink_admin']['user_auth']['username']; + $otherQuotaRemark = !empty($otherQuotaRemark) ? $otherQuotaRemark : '无'; + addOperationLog(array( + "op_type"=>1, + 'op_name'=>'修改额外额度记录', + "key"=>'/'.$admin_account.'修改了额外额度'.$otherQuota.',备注信息为'.$otherQuotaRemark.'/', + "url"=>U("TestingResource/index") + )); return $this->ajaxReturn(['status' => 1, 'message' => '设置成功']); } - public function getUserRoles() - { - $gameId = I('game_id', 0); - $serverId = I('server_id', 0); - $userAccount = I('user_account', ''); - $server = M('server', 'tab_')->field(['id', 'server_name', 'server_id'])->where(['id' => $serverId])->find(); - if (is_null($server)) { - return $this->ajaxReturn(['status' => 0, 'message' => '区服不存在']); - } - - $user = M('user', 'tab_')->field(['id', 'promote_id'])->where(['account' => $userAccount])->find(); - if (is_null($user)) { - return $this->ajaxReturn(['status' => 0, 'message' => '账号不存在']); - } - - $testingUser = M('testing_user', 'tab_')->where(['user_account' => $userAccount])->find(); - $isTestingAccount = is_null($testingUser) ? false : true; - - $roles = M('user_play_info', 'tab_') - ->field(['id', 'role_id', 'role_name']) - ->where(['user_account' => $userAccount, 'game_id' => $gameId, 'server_id' => $server['server_id']]) - ->select(); - return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['roles' => $roles, 'is_testing_account' => $isTestingAccount]]); - } - public function getResourceTypes() { $gameId = I('game_id', 0); @@ -759,4 +753,33 @@ class TestingResourceController extends ThinkController return $this->ajaxReturn(['status' => 0, 'message' => $e->getMessage()]); } } + + public function getUserRoles() + { + $gameId = I('game_id', 0); + $roleId = I('role_id', 0); + + $game = M('game', 'tab_')->where(['id' => $gameId])->find(); + if (is_null($game)) { + return $this->ajaxReturn(['status' => 0, 'message' => '游戏不存在']); + } + + $gameIds = [$gameId]; + if ($game['data_share'] == 1) { + $gameRepository = new GameRepository(); + $baseGames = $gameRepository->getBaseGames(); + $baseGame = $gameRepository->getBaseGameByGameId($gameId, $baseGames); + if (is_null($baseGame)) { + return $this->ajaxReturn(['status' => 0, 'message' => '游戏不存在']); + } + $gameIds = $gameRepository->getGameIdsByBaseGame($baseGame); + } + + $roles = M('user_play_info', 'tab_') + ->field(['id', 'role_id', 'role_name']) + ->where(['role_id' => $roleId, 'game_id' => ['in', $gameIds]]) + ->select(); + + return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['roles' => $roles]]); + } } \ No newline at end of file diff --git a/Application/Admin/View/CompanyStatement/editWmCpStatement.html b/Application/Admin/View/CompanyStatement/editWmCpStatement.html index f3f315e64..e292a9d01 100644 --- a/Application/Admin/View/CompanyStatement/editWmCpStatement.html +++ b/Application/Admin/View/CompanyStatement/editWmCpStatement.html @@ -380,7 +380,7 @@ ${it.aggregate_money} {@if it.statement_type==0} - % + % % % @@ -529,7 +529,13 @@ var type = $(this).attr("name"); - if(!CHECK.number.test(val)){ + if(!CHECK.number.test(val)&&type!='other_amount'&&type!="sum_money"){ + layer.msg('结算单中的罚款和税率必须是数字,且不能为空'); + dom.val(vdata); + return false; + } + + if(!CHECK.othernumber.test(val)&&(type=='other_amount'||type=="sum_money")){ layer.msg('结算单中的罚款和税率必须是数字,且不能为空'); dom.val(vdata); return false; @@ -546,16 +552,16 @@ var index = $(this).data("index"); var td = DATAOBJ.statement_info[index]; - if( $(this).attr("name") == "first_ratio"){ + if( $(this).attr("name") == "ratio"){ td['second_ratio'] = 100-val; } if( $(this).attr("name") == "second_ratio"){ - td['first_ratio'] = 100-val; + td['ratio'] = 100-val; } if(DATAOBJ.pay_type == 1){ //甲方收款 - var ratio = td['first_ratio']/100; + var ratio = td['ratio']/100; }else{ //乙方 var ratio = td['second_ratio']/100; @@ -580,6 +586,7 @@ } var CHECK = { number: /^\d+(\.{1}\d+)?$/, + othernumber: /^\-?\d+(\.{1}\d+)?$/, mobile: /^1[3456789]\d{9}$/, BankNo: /^([1-9]{1})\d{10,19}$/, money: /((^[1-9]\d*)|^0)(\.\d{0,2}){0,1}$/ diff --git a/Application/Admin/View/CompanyStatement/showCpStatementView.html b/Application/Admin/View/CompanyStatement/showCpStatementView.html index bab81c5f0..505fef986 100644 --- a/Application/Admin/View/CompanyStatement/showCpStatementView.html +++ b/Application/Admin/View/CompanyStatement/showCpStatementView.html @@ -126,9 +126,16 @@ {$datas['show_company_name']} - {$time}年{$datas["time"]}月 + + {$time}年{$datas["time"]}月 + - {$datas['statement_info'][0]['game_name']|default="--"}({$datas['statement_info'][0]['statement_begin_time']}-{$datas['statement_info'][0]['statement_end_time']}) + + + {$datas['statement_info'][0]['statement_begin_time']}-{$datas['statement_info'][0]['statement_end_time']} + + + {$datas['statement_info'][0]['game_name']|default="--"} -- -- -- @@ -138,7 +145,12 @@ -- -{$datas['statement_info'][0]['sum_money']|default="--"} - {$datas['statement_info'][0]['game_name']|default="--"}({$datas['statement_info'][0]['statement_begin_time']}-{$datas['statement_info'][0]['statement_end_time']}) + + + {$datas['statement_info'][0]['statement_begin_time']}-{$datas['statement_info'][0]['statement_end_time']} + + + {$datas['statement_info'][0]['game_name']|default="--"} {$datas['statement_info'][0]['platform_money']|default="--"} {$datas['statement_info'][0]['aggregate_money']|default="--"} {$datas['statement_info'][0]['sum_amount']|default="--"} @@ -154,7 +166,12 @@ - {$statement_info['game_name']|default="--"}({$statement_info['statement_begin_time']}-{$statement_info['statement_end_time']}) + + + {$statement_info['statement_begin_time']}-{$statement_info['statement_end_time']} + + + {$statement_info['game_name']|default="--"} -- -- -- @@ -165,7 +182,12 @@ -{$statement_info['sum_money']|default="--"} - {$statement_info['game_name']|default="--"}({$statement_info['statement_begin_time']}-{$statement_info['statement_end_time']}) + + + {$statement_info['statement_begin_time']}-{$statement_info['statement_end_time']} + + + {$statement_info['game_name']|default="--"} {$statement_info['platform_money']|default="--"} {$statement_info['aggregate_money']|default="--"} {$statement_info['sum_amount']|default="--"} diff --git a/Application/Admin/View/SocietyInfo/lists.html b/Application/Admin/View/SocietyInfo/lists.html index 29495cd47..60652ab17 100644 --- a/Application/Admin/View/SocietyInfo/lists.html +++ b/Application/Admin/View/SocietyInfo/lists.html @@ -89,6 +89,8 @@   + + @@ -165,8 +167,28 @@ 是否为意向客户 备注信息 对接人 - 录入时间 - 最后沟通时间 + + + + 录入时间▲ + + 录入时间▼ + 录入时间 + + + + + + + 最后沟通时间▲ + + 最后沟通时间▼ + 最后沟通时间 + + + 操作 @@ -429,6 +451,23 @@ return false; }); + $(".paixu").click(function () { + var that = $(this); + $data_order = that.attr('data-order'); + $order_type = '{$userarpu_order}'; + if ($order_type == '' || $order_type == '4') { + $(".sortBy").attr('name', 'data_order'); + val = '3,' + $data_order; + $(".sortBy").attr('value', val); + $("#search").click(); + } else if ($order_type == '3') { + $(".sortBy").attr('name', 'data_order'); + val = '4,' + $data_order; + $(".sortBy").attr('value', val); + $("#search").click(); + } + }); + $("#excel_back").click(function () { $(".search_list").show(); $(".excel_list").hide(); diff --git a/Application/Admin/View/TestingResource/apply.html b/Application/Admin/View/TestingResource/apply.html index 153a22811..a46acb912 100644 --- a/Application/Admin/View/TestingResource/apply.html +++ b/Application/Admin/View/TestingResource/apply.html @@ -264,9 +264,9 @@ body { diff --git a/Application/Home/View/default/Query/userRoles.html b/Application/Home/View/default/Query/userRoles.html index ecb8c5b46..31f4a578a 100644 --- a/Application/Home/View/default/Query/userRoles.html +++ b/Application/Home/View/default/Query/userRoles.html @@ -74,6 +74,9 @@ +
+ +
@@ -115,6 +118,7 @@ 注册IP + 角色ID 最近登录时间 @@ -166,6 +170,7 @@ {$record.device_number} {$record.register_time} {$record.register_ip} + {$record.role_id} {$record.login_time} {$record.login_ip} diff --git a/Application/Home/View/default/TestingResource/apply.html b/Application/Home/View/default/TestingResource/apply.html index b43622e30..0c52547e7 100644 --- a/Application/Home/View/default/TestingResource/apply.html +++ b/Application/Home/View/default/TestingResource/apply.html @@ -216,9 +216,9 @@