From 1279cbfe3baa600186d62607f2020c95feedbfa3 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Mon, 28 Jun 2021 16:04:22 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessAffairsAwardController.class.php | 34 +++--- .../Admin/Controller/GameController.class.php | 43 +++++--- .../MarketPercentageController.class.php | 38 ++++++- .../Controller/TimingController.class.php | 103 ++++++++---------- .../businessAffairsList.html | 30 ++--- Application/Admin/View/Game/add.html | 12 ++ Application/Admin/View/Game/edit.html | 16 +++ Application/Admin/View/Game/lists.html | 2 + .../MarketPercentage/marketstaffsettle.html | 53 ++++++++- Data/update.sql | 32 +++++- 10 files changed, 248 insertions(+), 115 deletions(-) diff --git a/Application/Admin/Controller/BusinessAffairsAwardController.class.php b/Application/Admin/Controller/BusinessAffairsAwardController.class.php index b398a9e50..0a27ca80a 100644 --- a/Application/Admin/Controller/BusinessAffairsAwardController.class.php +++ b/Application/Admin/Controller/BusinessAffairsAwardController.class.php @@ -214,15 +214,6 @@ class BusinessAffairsAwardController extends ThinkController $detail .= "
"; } - $data[$key]['total_quarter_bonus_pool'] = round($value['quarter_bonus_pool'] * 0.25,2); - - $time = date("m",strtotime($value['time'])); - if (!in_array($time,$check_quarter)) { - $data[$key]["quarter_award"] = "0.00"; - } - - $data[$key]['person_award'] = $data[$key]['quarter_award'] + $value['month_award']; - if ($value['verify_status']) { $data[$key]['verify_detail'] = $detail.date('Y-m-d H:i:s',$value['verify_time']); } else { @@ -234,17 +225,20 @@ class BusinessAffairsAwardController extends ThinkController if ($_REQUEST['export']) { - $title = ['time' => '月份', - 'relation_game_name' => '游戏名称', - 'pay_amount' => '产品流水', - 'ratio' => '抽成比例', - 'game_belong_name' => '奖励归属', - 'month_bonus_pool' => '本月奖金池总额', - 'total_quarter_bonus_pool'=>'本季度累计激励', - 'quarter_bonus_pool' => '个人发放激励', - 'month_award' => '流水个人奖金', - 'person_award' => '个人奖金总额', - 'verify_detail' => '审批状态']; + $title = [ + 'time' => '时间', + 'game_belong_name' => '对应商务', + 'relation_game_name' => '产品', + 'pay_amount' => '流水', + + 'game_bonus_pool' => '该产品奖金池', + 'month_award'=>'商务个人本月应得', + // '' => '助理', + 'assistant_month_award' => '助理本月应得', + 'department_award' => '部门累计', + 'person_award' => '个人激励', + 'verify_detail' => '审批状态' + ]; data2csv($data, '商务奖金汇总', $title); } diff --git a/Application/Admin/Controller/GameController.class.php b/Application/Admin/Controller/GameController.class.php index 24751d655..08a85b7d8 100644 --- a/Application/Admin/Controller/GameController.class.php +++ b/Application/Admin/Controller/GameController.class.php @@ -224,16 +224,21 @@ class GameController extends ThinkController $_POST['download_ways'] = $gameService->getDownLoadWaysValue($downloadWays); - $realname = M("member") - ->field("real_name") - ->where(['uid' => I('post.game_belong_id')]) - ->find()['real_name']; + $gameBelongId = I('post.game_belong_id', 0); + $gameAssistantId = I('post.game_assistant_id', 0); - if(!$realname) { - $realname = ''; + if ($gameAssistantId > 0 && $gameBelongId == 0) { + return $this->error("请选择游戏所属商务"); } - $_POST['game_belong_name'] =$realname; + $members = M("member") + ->field(['uid', 'real_name']) + ->where(['uid' => ['in', [$gameBelongId, $gameAssistantId]]]) + ->select(); + $members = index_by_column('real_name', $members); + + $_POST['game_belong_name'] = $members[$gameBelongId] ?? ''; + $_POST['game_assistant_name'] = $members[$gameAssistantId] ?? ''; $game = D(self::model_name);//M('$this->$model_name','tab_'); $res = $game->update(); @@ -432,17 +437,21 @@ ADD COLUMN `kefu_qq` varchar(255) NULL DEFAULT '' COMMENT 'kefu_qq_type为2 时 $_POST['download_ways'] = $gameService->getDownLoadWaysValue($downloadWays); + $gameBelongId = I('post.game_belong_id', 0); + $gameAssistantId = I('post.game_assistant_id', 0); - $realname = M("member") - ->field("real_name") - ->where(['uid' => I('post.game_belong_id')]) - ->find()['real_name']; - - if(!$realname) { - $realname = ''; + if ($gameAssistantId > 0 && $gameBelongId == 0) { + return $this->error("请选择游戏所属商务"); } + + $members = M("member") + ->field(['uid', 'real_name']) + ->where(['uid' => ['in', [$gameBelongId, $gameAssistantId]]]) + ->select(); + $members = index_by_column('real_name', $members); - $_POST['game_belong_name'] =$realname; + $_POST['game_belong_name'] = $members[$gameBelongId] ?? ''; + $_POST['game_assistant_name'] = $members[$gameAssistantId] ?? ''; unset($_POST['apply_auth']); @@ -498,7 +507,9 @@ ADD COLUMN `kefu_qq` varchar(255) NULL DEFAULT '' COMMENT 'kefu_qq_type为2 时 $otherData['kefu_qq_type'] = I('post.kefu_qq_type'); $otherData['data_share'] = I('post.data.share'); $otherData['game_belong_id'] = I('post.game_belong_id'); - $otherData['game_belong_name'] = $realname; + $otherData['game_belong_name'] = $_POST['game_belong_name']; + $otherData['game_assistant_id'] = I('post.game_assistant_id'); + $otherData['game_assistant_name'] = $_POST['game_assistant_name']; $otherData['data_share'] = I('post.data_share'); M('Game', 'tab_')->data($otherData)->where(array('id' => $another['id']))->save(); diff --git a/Application/Admin/Controller/MarketPercentageController.class.php b/Application/Admin/Controller/MarketPercentageController.class.php index 3d5f54ea1..c6494cc60 100644 --- a/Application/Admin/Controller/MarketPercentageController.class.php +++ b/Application/Admin/Controller/MarketPercentageController.class.php @@ -708,6 +708,7 @@ class MarketPercentageController extends ThinkController $this->assign('coefficient_check', true); $this->assign('market_check', true); $this->assign('finance_check', true); + $this->assign('personnel_check', true); $this->assign('coefficient_in_check', true); } else { $exportRule = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME . "_coefficient_check"); @@ -716,6 +717,8 @@ class MarketPercentageController extends ThinkController $this->assign('market_check', $this->checkRule($exportRule, array('in', '1,2'))); $exportRule = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME . "_finance_check"); $this->assign('finance_check', $this->checkRule($exportRule, array('in', '1,2'))); + $exportRule = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME . "_personnel_check"); + $this->assign('personnel_check', $this->checkRule($exportRule, array('in', '1,2'))); $exportRule = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME . "_coefficient_in_check"); $this->assign('coefficient_in_check', $this->checkRule($exportRule, array('in', '1,2'))); } @@ -752,7 +755,7 @@ class MarketPercentageController extends ThinkController if ($_REQUEST['export'] && $this->checkRule($Rule, array('in', '1,2'))) { - if (!$value['market_check'] || !$value['finance_check']) { + if (!$value['market_check'] || !$value['finance_check'] || !$value['personnel_check']) { unset($data[$key]); continue; } @@ -792,6 +795,10 @@ class MarketPercentageController extends ThinkController $data[$key]['finance_check_detail'] = "-----"; } + if (!$value['personnel_check']) { + $data[$key]['personnel_check_detail'] = "-----"; + } + if (!$value['coefficient_check']) { $data[$key]['coefficient_check_detail'] = "-----"; } @@ -799,6 +806,7 @@ class MarketPercentageController extends ThinkController if ($_REQUEST['export']) { $data[$key]['market_check_detail'] = str_replace("
", '', $data[$key]['market_check_detail']); $data[$key]['finance_check_detail'] = str_replace("
", '', $data[$key]['finance_check_detail']); + $data[$key]['personnel_check_detail'] = str_replace("
", '', $data[$key]['personnel_check_detail']); $data[$key]['coefficient_check_detail'] = str_replace("
", '', $data[$key]['coefficient_check_detail']); } @@ -910,7 +918,8 @@ class MarketPercentageController extends ThinkController 'wait_commission' => '本月待发金额合计', 'coefficient_check_detail' => '绩效确认', 'market_check_detail' => '市场部确认', - 'finance_check_detail' => '财务部审批']; + 'finance_check_detail' => '财务部审批', + 'personnel_check_detail' => '人事部审批']; foreach ($data as $key => $value) { $line = $key + 2; @@ -1586,6 +1595,31 @@ class MarketPercentageController extends ThinkController } + //财务部审批操作 + public function doPersonnelCheck() + { + + $ids = $_REQUEST['ids']; + + if (!$ids) { + $this->ajaxReturn(['status' => 0, 'info' => '操作失败,id不能为空']); + } + + $admin = $_SESSION['onethink_admin']['user_auth']['username']; + $personnel_check_detail = "人事部已审批({$admin})
" . date("Y-m-d H:i:s", time()); + + $is_save = SM("market_altogether", "tab_") + ->where(['id' => ['in', $ids], 'personnel_check' => 0]) + ->save(['personnel_check' => 1, 'personnel_check_detail' => $personnel_check_detail]); + + if (!$is_save) { + $this->ajaxReturn(['status' => 0, 'info' => '操作失败']); + } + + $this->ajaxReturn(['status' => 1, 'info' => '人事部审批成功']); + + } + public function companybelonggame($row = 10, $p = 1) { diff --git a/Application/Admin/Controller/TimingController.class.php b/Application/Admin/Controller/TimingController.class.php index d167bf035..8e3771422 100644 --- a/Application/Admin/Controller/TimingController.class.php +++ b/Application/Admin/Controller/TimingController.class.php @@ -1559,38 +1559,35 @@ class TimingController extends AdminController { - public function setbusinessAffairsAward() { + public function setbusinessAffairsAward($month = null) { echo date("Y-m-d H:i:s")."----------------------商务奖金计算----------------------\n"; -// dump($this->businessAffairRatio(3471300));die(); - - - if (!$_REQUEST['time']) { - $time = time(); - } else { - $time = strtotime($_REQUEST['time']); - - $time = strtotime(date('Y-m',strtotime(date('Y',$time).'-'.(date('m',$time)+1).'-01'))); - + if (is_null($month)) { + $month = date('Y-m', strtotime(date('Y-m-01') . ' -1 month')); } - list($becomeTimeList,$becomeTimeCount) = $this->getAffairList(date('Y-m',strtotime(date('Y',$time).'-'.(date('m',$time)-1).'-01'))); -// dump([$becomeTimeList,$becomeTimeCount]);die(); + $quarterMonthIndex = date('n', strtotime($month . '-01')) % 3; + $quarterBeforeMonth = $quarterMonthIndex == 1 ? null : date('Y-m', strtotime($month . '-01' . ' -1 month')); + + list($becomeTimeList, $becomeTimeCount) = $this->getAffairList($month); - $time1 = date('Y-m',strtotime(date('Y',$time).'-'.(date('m',$time)-1).'-01')); + /* $time1 = date('Y-m',strtotime(date('Y',$time).'-'.(date('m',$time)-1).'-01')); $time2 = date('Y-m',strtotime(date('Y',$time).'-'.(date('m',$time)-2).'-01')); $time3 = date('Y-m',strtotime(date('Y',$time).'-'.(date('m',$time)-3).'-01')); - $lasttime = [$time2,$time3]; + $lasttime = [$time2,$time3]; */ + $firstday = $month . '-01'; + $lastday = date('Y-m-d', strtotime($firstday . ' +1 month -1 day')); + $timeRange = [strtotime($firstday . ' 00:00:00'), strtotime($lastday . ' 23:59:59')]; $tempoparyData = M("spend","tab_") - ->field("tab_spend.*,from_unixtime(payed_time,'%Y-%m') time,from_unixtime(payed_time,'%Y') year,from_unixtime(payed_time,'%m') month,relation_game_id,relation_game_name,game_belong_id,game_belong_name") + ->field("tab_spend.*,from_unixtime(payed_time,'%Y-%m') time,from_unixtime(payed_time,'%Y') year,from_unixtime(payed_time,'%m') month,relation_game_id,relation_game_name,game_belong_id,game_belong_name,game_assistant_id,game_assistant_name") ->join("left join tab_game on tab_game.id=tab_spend.game_id") - ->where(['tab_spend.pay_status'=>1,'game_belong_id'=>['neq',0],'pay_way' => ['egt', 0]]) + ->where(['tab_spend.pay_status' => 1, 'game_belong_id' => ['neq',0], 'pay_way' => ['egt', 0], 'tab_spend.payed_time' => ['between', $timeRange]]) ->select(false); - $lastdata = M()->table("({$tempoparyData}) a") + /* $lastdata = M()->table("({$tempoparyData}) a") ->field("*,sum(pay_amount) pay_amount") ->where(['time'=>['in',$lasttime]]) ->group("time,relation_game_id,game_belong_id") @@ -1600,73 +1597,60 @@ class TimingController extends AdminController { foreach ($lastdata as $key => $value) { $handleData[$value['time'].$value['game_belong_id'].$value['relation_game_id']] = $value; - } + } */ $data = M()->table("({$tempoparyData}) a") - ->field("sum(pay_amount) pay_amount,time,year,month,relation_game_id,relation_game_name,game_belong_id,game_belong_name") - ->where(['time'=>$time1]) + ->field("sum(pay_amount) pay_amount,time,year,month,relation_game_id,relation_game_name,game_belong_id,game_belong_name,game_assistant_id,game_assistant_name") + ->where(['time' => $month]) ->group("time,relation_game_id,game_belong_id") ->select(); - $sum_amount = M()->table("({$tempoparyData}) a") + /* $sum_amount = M()->table("({$tempoparyData}) a") ->field("sum(pay_amount) pay_amount") - ->where(['time'=>$time1]) - ->find()['pay_amount']; + ->where(['time' => $month]) + ->find()['pay_amount']; */ //判断是不是初次 - $is_hav = M("business_affairs_award_pool","tab_")->where(['time'=>$time2])->find(); + // $is_hav = M("business_affairs_award_pool","tab_")->where(['time' => $time2])->find(); - $month_bonus_pool = 0; + $sum_amount = array_sum(array_column($data, 'pay_amount')); $quarter_bonus_pool = 0; - foreach($data as $key => $value) { - - $month_bonus_pool += $value['pay_amount']; - -// if ($is_hav) { -// for($i = (($value['month']%3)?(($value['month']%3)-1):2); $i > 0; $i--) { -// -// $date = date("Y-m",strtotime($value['year'].'-'.(($value['month']-$i)>0?($value['month']-$i):($value['month']-$i+12)))); -// -// } -// } - - } - - $last_amount = M("business_affairs_award_pool","tab_")->where(['time'=>['in',$lasttime]])->group("month_bonus_pool")->select(false); - - $last_amount = M()->table("({$last_amount}) a")->sum("month_bonus_pool"); + /* foreach($data as $key => $value) { + $sum_amount += $value['pay_amount']; + } */ - $month_bonus_pool = $this->businessAffairRatio($month_bonus_pool); - $quarter_bonus_pool = $month_bonus_pool + $last_amount; + /* $last_amount = 0; + if (!is_null($quarterBeforeMonth)) { + $last_amount = M("business_affairs_award_pool", "tab_")->where(['time' => $quarterBeforeMonth])->getField('month_bonus_pool'); + $last_amount = $last_amount ?? 0; + } */ - foreach ($data as $key => $value){ + $month_bonus_pool = $this->businessAffairRatio($sum_amount); + foreach ($data as $key => $value) { echo "{$value['time']},{$value['game_belong_name']},{$value['pay_amount']}\n"; $value['month_bonus_pool'] = $month_bonus_pool; - $value['quarter_bonus_pool'] = $quarter_bonus_pool; - unset($value['year']); unset($value['month']); - $value['quarter_award'] = $value['quarter_bonus_pool']*0.25*(($becomeTimeList[$value['game_belong_id']]?$becomeTimeList[$value['game_belong_id']]:0)/$becomeTimeCount); + $becomeTimeMonth = $becomeTimeList[$value['game_belong_id']] ? $becomeTimeList[$value['game_belong_id']] : 0; + $becomeTimeRate = $becomeTimeMonth == 0 || $becomeTimeCount == 0 ? 0 : $becomeTimeMonth/$becomeTimeCount; - $is_assistant = M("ucenter_member") + /* $is_assistant = M("ucenter_member") ->field("sys_ucenter_member.id admin_id,become_time") ->join("left join sys_auth_group_access access on sys_ucenter_member.id = access.uid") ->join("left join sys_auth_group auth on access.group_id=auth.id") ->where(['title' => ['like', '%助理%'],'sys_ucenter_member.id'=>$value['game_belong_id']]) - ->select(); - - if (!$is_assistant) { - $value['month_award'] = ($value['pay_amount']/$sum_amount)*$value['month_bonus_pool']*0.7; - } else { - $value['month_award'] = ($value['pay_amount']/$sum_amount)*$value['month_bonus_pool']*0.05; - } + ->select(); */ - $value['month_award'] = round($value['month_award'],2); - $value['quarter_award'] = round($value['quarter_award'],2); + $value['total_pay_amount'] = $sum_amount; + $value['game_bonus_pool'] = round(($value['pay_amount']/$sum_amount)*$value['month_bonus_pool'], 2); + $value['month_award'] = round($value['game_bonus_pool']*0.7, 2); + $value['assistant_month_award'] = round($value['game_bonus_pool']*0.05, 2); + $value['department_award'] = round($value['game_bonus_pool']*0.25, 2); + $value['person_award'] = round($value['game_bonus_pool']*0.25*$becomeTimeRate, 2); if (!$becomeTimeCount) { $value['month_award'] = 0; @@ -1691,7 +1675,6 @@ class TimingController extends AdminController { } else { M("business_affairs_award_pool","tab_")->add($value); } - } echo date("Y-m-d H:i:s")."----------------------商务奖金计算----------------------\n"; diff --git a/Application/Admin/View/BusinessAffairsAward/businessAffairsList.html b/Application/Admin/View/BusinessAffairsAward/businessAffairsList.html index afdcb886a..d587272f9 100644 --- a/Application/Admin/View/BusinessAffairsAward/businessAffairsList.html +++ b/Application/Admin/View/BusinessAffairsAward/businessAffairsList.html @@ -176,16 +176,16 @@ - 月份 - 游戏名称 - 产品流水 - 抽成比例 - 奖金归属人 - 本月奖金池总额 - 本季度累计激励 - 个人发放激励 - 流水个人奖金 - 个人奖金总额 + 时间 + 对应商务 + 产品 + 流水 + 该产品奖金池 + 商务个人本月应得 + 助理 + 助理本月应得 + 部门累计 + 个人激励 审批状态 @@ -202,14 +202,14 @@ {$data.time|default='无'} + {$data.game_belong_name|default='无'} {$data.relation_game_name|default='无'} {$data.pay_amount|default='0'} - {$data.ratio|default='--'} - {$data.game_belong_name|default='无'} - {$data.month_bonus_pool|default='0'} - {$data.total_quarter_bonus_pool|default='0'} - {$data.quarter_award|default='0'} + {$data.game_bonus_pool|default='0'} {$data.month_award|default='0'} + {$data.game_assistant_name|default='无'} + {$data.assistant_month_award|default='0'} + {$data.department_award|default='0'} {$data.person_award|default='0'} {$data.verify_detail|default='无'} diff --git a/Application/Admin/View/Game/add.html b/Application/Admin/View/Game/add.html index bb4fc360f..25d8b48a5 100644 --- a/Application/Admin/View/Game/add.html +++ b/Application/Admin/View/Game/add.html @@ -80,6 +80,18 @@ + + 商务助理: + + + + + 运营平台 diff --git a/Application/Admin/View/Game/edit.html b/Application/Admin/View/Game/edit.html index a2c185650..749676677 100644 --- a/Application/Admin/View/Game/edit.html +++ b/Application/Admin/View/Game/edit.html @@ -104,6 +104,22 @@ + + 商务助理: + + + + + 运营平台 diff --git a/Application/Admin/View/Game/lists.html b/Application/Admin/View/Game/lists.html index e689f0f99..a2dafa85e 100644 --- a/Application/Admin/View/Game/lists.html +++ b/Application/Admin/View/Game/lists.html @@ -161,6 +161,7 @@ text-indent:0; 排序设置 添加关联 游戏归属 + 商务助理 操作 @@ -248,6 +249,7 @@ text-indent:0; {$data.game_belong_name|default='无'} + {$data.game_assistant_name|default='无'} 编辑 删除 diff --git a/Application/Admin/View/MarketPercentage/marketstaffsettle.html b/Application/Admin/View/MarketPercentage/marketstaffsettle.html index 2c575d913..f5fd381e9 100644 --- a/Application/Admin/View/MarketPercentage/marketstaffsettle.html +++ b/Application/Admin/View/MarketPercentage/marketstaffsettle.html @@ -177,6 +177,9 @@ 财务部审批 + + 人事部审批 + 绩效导入 @@ -213,6 +216,7 @@ 绩效确认 市场部确认 财务部审批 + 人事部审批 @@ -226,7 +230,7 @@ - + {$data.pay_time|default='无'} {$data.real_name|default='无'} {$data.leave_time|default='--'} @@ -251,6 +255,7 @@ {$data['coefficient_check_detail']|default=''} {$data['market_check_detail']|default=''} {$data['finance_check_detail']|default=''} + {$data['personnel_check_detail']|default=''} 合计 @@ -429,6 +434,52 @@ }); + $("#personnel_check").on("click",function(){ + var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { + if($(elem).data("personnel_check") == 0 && $(elem).data("finance_check") == 1 && $(elem).data("market_check") == 1){ + return $(elem).val(); + } + }).get(); + + if(text.length < 1){ + layer.msg("" + '无需要进行[人事部审批]的申请,仅[人事部未审批且市场部已确认]状态可以进行[人事部审批]操作'); + return; + } + + text = text.join(","); + layer.confirm('【警告】[人事部审批]将不可回退,如需继续请点击确认', { + btn: ['确认','取消'], + title:false + }, function(index){ + layer.close(index); + _doAgreeApply(); + }); + function _doAgreeApply(){ + //执行 + layer.load(2); + $.ajax({ + type: "POST", + url: "{:U('doPersonnelCheck')}", + dataType: 'json', + async: true, + data: {ids:text}, + success:function(data){ + layer.closeAll('loading'); + if(data.status==1){ + layer.msg("" + data.info + ""); + setTimeout(function(){ + window.location.reload(); + },1500); + }else{ + layer.msg("" + data.info + ""); + return false; + } + } + }); + } + + }); + //搜索功能 $("#search").click(function(){ var url = $(this).attr('url'); diff --git a/Data/update.sql b/Data/update.sql index bf0b9f9bd..fdf441e35 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -2835,4 +2835,34 @@ ADD COLUMN `check_time` int(11) NULL DEFAULT 0 COMMENT '确认时间' AFTER `sta ALTER TABLE `tab_spend_refund` ADD COLUMN `admin` varchar(50) NULL DEFAULT '' COMMENT '操作人' AFTER `check_time`; -alter table sys_auth_group add column `allow_over_week` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否允许跨周补链' after show_promote; \ No newline at end of file +alter table sys_auth_group add column `allow_over_week` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否允许跨周补链' after show_promote; + +CREATE TABLE `tab_business_affairs_award_pool` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `time` varchar(20) NOT NULL DEFAULT '' COMMENT '月份', + `pay_amount` decimal(13,2) NOT NULL COMMENT '流水', + `relation_game_id` int(11) NOT NULL COMMENT '游戏id', + `relation_game_name` varchar(50) NOT NULL DEFAULT '' COMMENT '游戏名', + `game_belong_id` int(11) NOT NULL DEFAULT '0' COMMENT '归属id', + `game_belong_name` varchar(50) NOT NULL DEFAULT '' COMMENT '归属名', + `game_assistant_id` int(11) NOT NULL DEFAULT '0' COMMENT '助理id', + `game_assistant_name` varchar(50) NOT NULL DEFAULT '' COMMENT '助理姓名', + `month_bonus_pool` decimal(13,2) NOT NULL DEFAULT '0.00' COMMENT '月奖金池', + `month_award` decimal(13,2) NOT NULL DEFAULT '0.00' COMMENT '月奖金', + `person_award` decimal(13,2) NOT NULL DEFAULT '0.00' COMMENT '个人激励', + `total_pay_amount` decimal(13,2) NOT NULL DEFAULT '0.00' COMMENT '月总流水', + `game_bonus_pool` decimal(13,2) NOT NULL DEFAULT '0.00' COMMENT '该产品奖金池', + `assistant_month_award` decimal(13,2) NOT NULL DEFAULT '0.00' COMMENT '助理本月应得', + `department_award` decimal(13,2) NOT NULL DEFAULT '0.00' COMMENT '部门累计', + `verify_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '审核状态 0 未审核 1 审核通过 2 审核拒绝', + `verify_time` int(11) NOT NULL DEFAULT '0' COMMENT '审核时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; + +ALTER TABLE `tab_game` +ADD COLUMN `game_assistant_id` int(11) NOT NULL DEFAULT 0 COMMENT '商务助理id' AFTER `game_belong_name`, +ADD COLUMN `game_assistant_name` varchar(50) NOT NULL DEFAULT '' COMMENT '商务助理姓名' AFTER `game_assistant_id`; + +ALTER TABLE `tab_market_altogether` +ADD COLUMN `personnel_check` tinyint(2) NULL DEFAULT 0 COMMENT '人事确认 0 未确认 1 确认' AFTER `finance_check_detail`, +ADD COLUMN `personnel_check_detail` varchar(100) NULL DEFAULT '' COMMENT '人事确认详情' AFTER `personnel_check`; \ No newline at end of file From 546abbfa72226fa2f75e6f79b0213c72e38e0410 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Tue, 29 Jun 2021 13:46:43 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A5=96=E9=87=91?= =?UTF-8?q?=E6=B1=A0=E6=80=BB=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessAffairsAwardController.class.php | 12 ++++++++---- .../BusinessAffairsAward/businessAffairsList.html | 3 +++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Application/Admin/Controller/BusinessAffairsAwardController.class.php b/Application/Admin/Controller/BusinessAffairsAwardController.class.php index 0a27ca80a..067ef2d3a 100644 --- a/Application/Admin/Controller/BusinessAffairsAwardController.class.php +++ b/Application/Admin/Controller/BusinessAffairsAwardController.class.php @@ -189,13 +189,13 @@ class BusinessAffairsAwardController extends ThinkController $map['verify_status'] = ['like',"%{$_REQUEST['verify_status']}%"]; } - $data = M("business_affairs_award_pool","tab_") + $query = M("business_affairs_award_pool","tab_") ->where($map); if (!$_REQUEST['export']) { - $data->page($page, $row); + $query->page($page, $row); } - $data = $data->order("time desc")->select(); + $data = $query->order("time desc")->select(); foreach ($data as $key => $value) { @@ -246,6 +246,10 @@ class BusinessAffairsAwardController extends ThinkController $count = M("business_affairs_award_pool","tab_") ->where($map) ->count(); + + $gameBonusPool = M("business_affairs_award_pool","tab_") + ->where($map) + ->sum('game_bonus_pool'); if(IS_ROOT){ $this->assign('verify_check',true); @@ -264,7 +268,7 @@ class BusinessAffairsAwardController extends ThinkController } $this->assign("list",$data); - + $this->assign("gameBonusPool", round(floatval($gameBonusPool), 2)); $this->display(); } diff --git a/Application/Admin/View/BusinessAffairsAward/businessAffairsList.html b/Application/Admin/View/BusinessAffairsAward/businessAffairsList.html index d587272f9..698046a64 100644 --- a/Application/Admin/View/BusinessAffairsAward/businessAffairsList.html +++ b/Application/Admin/View/BusinessAffairsAward/businessAffairsList.html @@ -215,6 +215,9 @@ + + 奖金池总额:{$gameBonusPool} + From d1aff92c9906df2109f694a569612d2196420388 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Tue, 29 Jun 2021 13:52:12 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=B8=8B=E8=BD=BDbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/BusinessAffairsAwardController.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/BusinessAffairsAwardController.class.php b/Application/Admin/Controller/BusinessAffairsAwardController.class.php index 067ef2d3a..699a9d29a 100644 --- a/Application/Admin/Controller/BusinessAffairsAwardController.class.php +++ b/Application/Admin/Controller/BusinessAffairsAwardController.class.php @@ -220,7 +220,7 @@ class BusinessAffairsAwardController extends ThinkController $data[$key]['verify_detail'] = '未审核'; } $data[$key]['ratio'] = round(($value['month_award']/$value['pay_amount']*100),2)."%"; - + $data[$key]['game_assistant_name'] = $value['game_assistant_name'] == '' ? '无' : $value['game_assistant_name']; } if ($_REQUEST['export']) { @@ -233,7 +233,7 @@ class BusinessAffairsAwardController extends ThinkController 'game_bonus_pool' => '该产品奖金池', 'month_award'=>'商务个人本月应得', - // '' => '助理', + 'game_assistant_name' => '助理', 'assistant_month_award' => '助理本月应得', 'department_award' => '部门累计', 'person_award' => '个人激励',