From d7d78e748d0a243e3440233bebd40ad25dbfcd58 Mon Sep 17 00:00:00 2001
From: ELF <360197197@qq.com>
Date: Fri, 26 Mar 2021 18:41:13 +0800
Subject: [PATCH 01/16] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B7=A8=E5=8C=BAbug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../TestingResourceController.class.php | 4 +--
.../Admin/View/TestingResource/apply.html | 2 +-
.../{index.html => roles.html} | 6 ++--
.../TestingResourceRepository.class.php | 28 +++++++++++++++++--
.../Service/TestingResourceService.class.php | 5 ++--
.../TestingResourceController.class.php | 1 +
6 files changed, 36 insertions(+), 10 deletions(-)
rename Application/Admin/View/TestingResource/{index.html => roles.html} (99%)
diff --git a/Application/Admin/Controller/TestingResourceController.class.php b/Application/Admin/Controller/TestingResourceController.class.php
index 1668dc596..6faf72c8c 100644
--- a/Application/Admin/Controller/TestingResourceController.class.php
+++ b/Application/Admin/Controller/TestingResourceController.class.php
@@ -13,7 +13,7 @@ use Base\Service\GameService;
class TestingResourceController extends ThinkController
{
- public function index()
+ public function roles()
{
$params = I('get.');
$gameId = $params['game_id'] ?? 0;
@@ -458,6 +458,7 @@ class TestingResourceController extends ThinkController
->find();
if ($bindingRole) {
$bindingRole['binding_time'] = $binding['create_time'];
+ $bindingRole['share_game_ids'] = $gameIds;
}
}
@@ -467,7 +468,6 @@ class TestingResourceController extends ThinkController
$hasItf = $gameSetting ? $gameSetting['has_itf'] : 0;
}
-
$testingResourceService = new TestingResourceService();
$quota = $testingResourceService->getRemainQuota($role, $bindingRole);
diff --git a/Application/Admin/View/TestingResource/apply.html b/Application/Admin/View/TestingResource/apply.html
index a46acb912..557f12371 100644
--- a/Application/Admin/View/TestingResource/apply.html
+++ b/Application/Admin/View/TestingResource/apply.html
@@ -692,7 +692,7 @@ body {
success: function(result){
if (result.status == 1) {
layer.msg(result.message, function(){
- parent.window.location.href = "{:U('index')}"
+ parent.window.location.href = "{:U('roles')}"
})
} else {
layer.msg(result.message)
diff --git a/Application/Admin/View/TestingResource/index.html b/Application/Admin/View/TestingResource/roles.html
similarity index 99%
rename from Application/Admin/View/TestingResource/index.html
rename to Application/Admin/View/TestingResource/roles.html
index 7ab71d248..eb3f96db2 100644
--- a/Application/Admin/View/TestingResource/index.html
+++ b/Application/Admin/View/TestingResource/roles.html
@@ -66,7 +66,7 @@
离职状态 |
@@ -174,6 +180,17 @@
todayBtn:true,
});
+ $('#become_time').datetimepicker({
+ format: 'yyyy-mm-dd',
+ language: "zh-CN",
+ showMeridian:true,
+ pickDate:true,
+ minView: 2,
+ autoclose: true,
+ pickTime:true,
+ todayBtn:true,
+ });
+
$bind_wx=$("#bind_wx").prop('checked');
if($bind_wx){
cpsw=check(1);
diff --git a/Data/update.sql b/Data/update.sql
index 1f69fdff3..785a3a4c1 100644
--- a/Data/update.sql
+++ b/Data/update.sql
@@ -2799,3 +2799,28 @@ ADD COLUMN `wm_statement_ids` int(11) NOT NULL DEFAULT 0 COMMENT '子系统财
ALTER TABLE `tab_reward_record`
ADD COLUMN `is_verify` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否审核' AFTER `settlement_time`,
ADD COLUMN `verify_detail` longtext NULL COMMENT '审核详情' AFTER `is_verify`;
+
+ALTER TABLE `tab_game`
+ADD COLUMN `game_belong_id` int(11) NOT NULL DEFAULT 0 COMMENT '归属市场员id' AFTER `data_share`,
+ADD COLUMN `game_belong_name` varchar(50) NOT NULL DEFAULT '' COMMENT '归属市场员姓名' AFTER `game_belong_id`;
+
+ALTER TABLE `sys_ucenter_member`
+ADD COLUMN `become_time` int(11) NOT NULL DEFAULT 0 COMMENT '转正时间' AFTER `leave_time`;
+
+CREATE TABLE `tab_business_affairs_award_pool` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `time` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci 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) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '游戏名',
+ `game_belong_id` int(11) NOT NULL DEFAULT 0 COMMENT '归属id',
+ `game_belong_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '归属名',
+ `month_bonus_pool` decimal(13, 2) NOT NULL DEFAULT 0.00 COMMENT '月奖金池',
+ `quarter_bonus_pool` decimal(13, 2) NOT NULL DEFAULT 0.00 COMMENT '季度奖金池',
+ `month_award` decimal(13, 2) NOT NULL DEFAULT 0.00 COMMENT '月奖金',
+ `quarter_award` decimal(13, 2) NOT NULL DEFAULT 0.00 COMMENT '季度奖金',
+ `person_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 AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
\ No newline at end of file
From 01a0d7c71766092d09f38689bb3f8c238e998872 Mon Sep 17 00:00:00 2001
From: zhengyongxing
Date: Wed, 31 Mar 2021 10:16:03 +0800
Subject: [PATCH 05/16] =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E6=89=93=E6=AC=BE?=
=?UTF-8?q?=E7=B3=BB=E7=BB=9Fbug=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controller/BusinessAffairsAwardController.class.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Application/Admin/Controller/BusinessAffairsAwardController.class.php b/Application/Admin/Controller/BusinessAffairsAwardController.class.php
index cad940422..7355612b3 100644
--- a/Application/Admin/Controller/BusinessAffairsAwardController.class.php
+++ b/Application/Admin/Controller/BusinessAffairsAwardController.class.php
@@ -129,9 +129,9 @@ class BusinessAffairsAwardController extends ThinkController
$data = $this->model->where(['id'=>$id])->find();
- $data['start_amount'] = floor($data['start_amount']);
- $data['end_amount'] = floor($data['end_amount']);
- $data['ratio'] = floor($data['ratio']);
+ $data['start_amount'] = round($data['start_amount'],2);
+ $data['end_amount'] = round($data['end_amount'],2);
+
$this->assign("data",$data);
From 7178181ebbefa2cffae986d93eecb39744bd190c Mon Sep 17 00:00:00 2001
From: zhengyongxing
Date: Wed, 31 Mar 2021 15:56:51 +0800
Subject: [PATCH 06/16] =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E6=89=93=E6=AC=BE?=
=?UTF-8?q?=E7=B3=BB=E7=BB=9Fbug=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../BusinessAffairsAwardController.class.php | 11 +++--
.../Controller/TimingController.class.php | 31 ++++++++++----
.../businessAffairsList.html | 42 ++++++++++++++++++-
3 files changed, 70 insertions(+), 14 deletions(-)
diff --git a/Application/Admin/Controller/BusinessAffairsAwardController.class.php b/Application/Admin/Controller/BusinessAffairsAwardController.class.php
index 7355612b3..d86f1b3a2 100644
--- a/Application/Admin/Controller/BusinessAffairsAwardController.class.php
+++ b/Application/Admin/Controller/BusinessAffairsAwardController.class.php
@@ -232,10 +232,13 @@ class BusinessAffairsAwardController extends ThinkController
if(IS_ROOT){
$this->assign('verify_check',true);
+ $this->assign('caculate_check',true);
}else {
$exportRule = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME . "_verify_check");
+ $caculate_check = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME . "_caculate_check");
$this->assign('verify_check', $this->checkRule($exportRule, array('in', '1,2')));
+ $this->assign('caculate_check', $this->checkRule($caculate_check, array('in', '1,2')));
}
$page = set_pagination($count, $row,$params);
@@ -272,12 +275,14 @@ class BusinessAffairsAwardController extends ThinkController
$this->ajaxReturn(['status'=>0,'info'=>'数据错误']);
}
+ }
+ public function reCaculate()
+ {
+ exec("source /etc/profile;cd " . ROOTTT . ";php " . SUBSITE_INDEX . " timing/setbusinessAffairsAward > /dev/null &");
-
-
-
+ $this->ajaxReturn(['status' => 1]);
}
}
diff --git a/Application/Admin/Controller/TimingController.class.php b/Application/Admin/Controller/TimingController.class.php
index 1dd2437e1..9080bc505 100644
--- a/Application/Admin/Controller/TimingController.class.php
+++ b/Application/Admin/Controller/TimingController.class.php
@@ -1563,14 +1563,22 @@ class TimingController extends AdminController {
echo date("Y-m-d H:i:s")."----------------------商务奖金计算----------------------\n";
- list($becomeTimeList,$becomeTimeCount) = $this->getAffairList(date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01')));
- dump($becomeTimeList);
- dump($becomeTimeCount);die();
- $time1 = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01'));
- $time2 = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-02'));
- $time3 = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-03'));
+ if (!$_REQUEST['time']) {
+ $time = time();
+ } else {
+ $time = strtotime($_REQUEST['time']);
+
+ $time = strtotime(date('Y-m',strtotime(date('Y',$time).'-'.(date('m',$time)+1).'-01')));
+
+ }
+
+ list($becomeTimeList,$becomeTimeCount) = $this->getAffairList(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];
@@ -1602,6 +1610,8 @@ class TimingController extends AdminController {
->field("sum(pay_amount) pay_amount")
->where(['time'=>$time1])
->find()['pay_amount'];
+ //判断是不是初次
+ $is_hav = M("business_affairs_award_pool","tab_")->where("time = {$time2}")->find();
foreach ($data as $key => $value){
@@ -1611,11 +1621,14 @@ class TimingController extends AdminController {
$value['quarter_bonus_pool'] = $this->businessAffairRatio($value['pay_amount']);
- for($i = (($value['month']%3)?(($value['month']%3)-1):2); $i == 0; $i--) {
- $value['quarter_bonus_pool'] +=
- $this->businessAffairRatio($handleData[$value['year'].'-'.(($value['month']-$i)>0?($value['month']-$i):($value['month']-$i+12)).$value['game_belong_id'].$value['relation_game_id']]['pay_amount']);
+ if ($is_hav) {
+ for($i = (($value['month']%3)?(($value['month']%3)-1):2); $i > 0; $i--) {
+ $value['quarter_bonus_pool'] +=
+ $this->businessAffairRatio($handleData[$value['year'].'-'.(($value['month']-$i)>0?($value['month']-$i):($value['month']-$i+12)).$value['game_belong_id'].$value['relation_game_id']]['pay_amount']);
+ }
}
+
unset($value['year']);
unset($value['month']);
diff --git a/Application/Admin/View/BusinessAffairsAward/businessAffairsList.html b/Application/Admin/View/BusinessAffairsAward/businessAffairsList.html
index 3ba33659b..fd67f55b6 100644
--- a/Application/Admin/View/BusinessAffairsAward/businessAffairsList.html
+++ b/Application/Admin/View/BusinessAffairsAward/businessAffairsList.html
@@ -102,8 +102,8 @@
- 市场业绩提成
- 说明:公会统计仅表示符合筛选条件下的数据统计,当搜索所属市场专员时,因为存在换绑等原因,所以不作为市场业绩统计依据
+ 商务奖金汇总
+
@@ -111,6 +111,15 @@
+
@@ -241,6 +250,35 @@
$(function(){
+ $('.recaculate').click(function(){
+ var url = $(this).attr('url');
+ layer.confirm('是否确认重算商务汇总!', {
+ title:'重算汇总?',
+ icon:0,
+ btn: ['重算','取消'] //按钮
+ }, function(){
+ $.ajax({
+ type: "POST",
+ url: url,
+ dataType: 'json',
+ async: false,
+ success:function(data){
+ if(data.status == 1) {
+ layer.msg("重新计算需要时间,请等待5分钟后再查看");
+ setTimeout(function(){
+ window.location.reload();
+ },1500);
+ } else {
+ layer.msg(data.info);
+ }
+
+ },
+ });
+ }, function(){
+ layer.close();
+ });
+
+ });
$(".verify").on("click",function(){
From 859fce06c4f810fe647ec87207d0a0633e430c3a Mon Sep 17 00:00:00 2001
From: zhengyongxing
Date: Wed, 31 Mar 2021 17:13:42 +0800
Subject: [PATCH 07/16] =?UTF-8?q?=E5=95=86=E5=8A=A1=E5=A5=96=E9=87=91?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../BusinessAffairsAwardController.class.php | 24 +++++++++++---
.../Controller/TimingController.class.php | 31 ++++++++++++++-----
.../businessAffairsList.html | 2 ++
3 files changed, 45 insertions(+), 12 deletions(-)
diff --git a/Application/Admin/Controller/BusinessAffairsAwardController.class.php b/Application/Admin/Controller/BusinessAffairsAwardController.class.php
index d86f1b3a2..150147eed 100644
--- a/Application/Admin/Controller/BusinessAffairsAwardController.class.php
+++ b/Application/Admin/Controller/BusinessAffairsAwardController.class.php
@@ -158,6 +158,8 @@ class BusinessAffairsAwardController extends ThinkController
public function businessAffairsList() {
+ $check_quarter = ["03","06","09","12"];
+
$map = [];
$params = I('get.');
@@ -181,9 +183,12 @@ class BusinessAffairsAwardController extends ThinkController
}
$data = M("business_affairs_award_pool","tab_")
- ->where($map)
- ->page($page, $row)
- ->select();
+ ->where($map);
+
+ if (!$_REQUEST['export']) {
+ $data->page($page, $row);
+ }
+ $data = $data->order("time desc")->select();
foreach ($data as $key => $value) {
@@ -201,6 +206,16 @@ class BusinessAffairsAwardController extends ThinkController
}else {
$detail .= " ";
}
+
+ $data[$key]['total_quarter_bonus_pool'] = $value['quarter_bonus_pool'] * 0.25;
+
+ $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 {
@@ -218,7 +233,8 @@ class BusinessAffairsAwardController extends ThinkController
'ratio' => '抽成比例',
'game_belong_name' => '奖励归属',
'month_bonus_pool' => '本月奖金池总额',
- 'quarter_bonus_pool' => '本季度累计激励',
+ 'total_quarter_bonus_pool'=>'本季度累计激励',
+ 'quarter_bonus_pool' => '个人发放激励',
'month_award' => '流水个人奖金',
'person_award' => '个人奖金总额',
'verify_detail' => '审批状态'];
diff --git a/Application/Admin/Controller/TimingController.class.php b/Application/Admin/Controller/TimingController.class.php
index 9080bc505..db5119a88 100644
--- a/Application/Admin/Controller/TimingController.class.php
+++ b/Application/Admin/Controller/TimingController.class.php
@@ -1583,7 +1583,7 @@ class TimingController extends AdminController {
$lasttime = [$time2,$time3];
$tempoparyData = M("spend","tab_")
- ->field("tab_spend.*,from_unixtime(payed_time,'%Y-%m') time,from_unixtime(payed_time,'%Y') year,from_unixtime(payed_time,'%Y-%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")
->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]])
->select(false);
@@ -1611,23 +1611,38 @@ class TimingController extends AdminController {
->where(['time'=>$time1])
->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();
- foreach ($data as $key => $value){
+ $month_bonus_pool = 0;
+ $quarter_bonus_pool = 0;
- echo "{$value['time']},{$value['game_belong_name']},{$value['pay_amount']}\n";
+ foreach($data as $key => $value) {
- $value['month_bonus_pool'] = $this->businessAffairRatio($value['pay_amount']);
+ $month_bonus_pool += $this->businessAffairRatio($value['pay_amount']);
- $value['quarter_bonus_pool'] = $this->businessAffairRatio($value['pay_amount']);
+ $quarter_bonus_pool = $this->businessAffairRatio($value['pay_amount']);
if ($is_hav) {
for($i = (($value['month']%3)?(($value['month']%3)-1):2); $i > 0; $i--) {
- $value['quarter_bonus_pool'] +=
- $this->businessAffairRatio($handleData[$value['year'].'-'.(($value['month']-$i)>0?($value['month']-$i):($value['month']-$i+12)).$value['game_belong_id'].$value['relation_game_id']]['pay_amount']);
+
+ $date = date("Y-m",strtotime($value['year'].'-'.(($value['month']-$i)>0?($value['month']-$i):($value['month']-$i+12))));
+ dump($date);
+
+ $quarter_bonus_pool +=
+ $this->businessAffairRatio($handleData[$date.$value['game_belong_id'].$value['relation_game_id']]['pay_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']);
diff --git a/Application/Admin/View/BusinessAffairsAward/businessAffairsList.html b/Application/Admin/View/BusinessAffairsAward/businessAffairsList.html
index fd67f55b6..afdcb886a 100644
--- a/Application/Admin/View/BusinessAffairsAward/businessAffairsList.html
+++ b/Application/Admin/View/BusinessAffairsAward/businessAffairsList.html
@@ -183,6 +183,7 @@
奖金归属人 |
本月奖金池总额 |
本季度累计激励 |
+ 个人发放激励 |
流水个人奖金 |
个人奖金总额 |
审批状态 |
@@ -206,6 +207,7 @@
{$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.month_award|default='0'} |
{$data.person_award|default='0'} |
From 110e5001ee8e15bc83f6a7a3dc1230f7f24b6c43 Mon Sep 17 00:00:00 2001
From: zhengyongxing
Date: Wed, 31 Mar 2021 17:26:21 +0800
Subject: [PATCH 08/16] =?UTF-8?q?=E5=95=86=E5=8A=A1=E6=B1=87=E6=80=BB?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
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 150147eed..4fc9a1804 100644
--- a/Application/Admin/Controller/BusinessAffairsAwardController.class.php
+++ b/Application/Admin/Controller/BusinessAffairsAwardController.class.php
@@ -58,7 +58,7 @@ class BusinessAffairsAwardController extends ThinkController
$this->ajaxReturn(["msg"=>"请填写抽成比例","code"=>0]);
}
- if(!$_POST['start_amount']) {
+ if(!$_POST['start_amount'] && $_POST['start_amount']!='0') {
$this->ajaxReturn(["msg"=>"请填写起始流水","code"=>0]);
}
@@ -98,7 +98,7 @@ class BusinessAffairsAwardController extends ThinkController
$this->ajaxReturn(["msg"=>"请填写抽成比例","code"=>0]);
}
- if(!$_POST['start_amount']) {
+ if(!$_POST['start_amount'] && $_POST['start_amount']!='0') {
$this->ajaxReturn(["msg"=>"请填写起始流水","code"=>0]);
}
From eda3c9bbe4ec841ad9e366373434e3ecb71ce6d5 Mon Sep 17 00:00:00 2001
From: zhengyongxing
Date: Wed, 31 Mar 2021 17:29:43 +0800
Subject: [PATCH 09/16] =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E6=89=93=E6=AC=BE?=
=?UTF-8?q?=E7=B3=BB=E7=BB=9Fbug=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Admin/Controller/BusinessAffairsAwardController.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Application/Admin/Controller/BusinessAffairsAwardController.class.php b/Application/Admin/Controller/BusinessAffairsAwardController.class.php
index 4fc9a1804..1b749cc05 100644
--- a/Application/Admin/Controller/BusinessAffairsAwardController.class.php
+++ b/Application/Admin/Controller/BusinessAffairsAwardController.class.php
@@ -30,7 +30,7 @@ class BusinessAffairsAwardController extends ThinkController
foreach ($data as $key => $value) {
- if(!$value['end_amount'] == '0') {
+ if($value['end_amount'] == '0') {
$data[$key]['end_amount'] = '永久';
}
From cddf09db6070e53a1b63f6a0d45bf15761791417 Mon Sep 17 00:00:00 2001
From: zhengyongxing
Date: Wed, 31 Mar 2021 17:33:29 +0800
Subject: [PATCH 10/16] =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E6=89=93=E6=AC=BE?=
=?UTF-8?q?=E7=B3=BB=E7=BB=9Fbug=E4=BF=AE=E5=A4=8D?=
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 1b749cc05..51ca65fbd 100644
--- a/Application/Admin/Controller/BusinessAffairsAwardController.class.php
+++ b/Application/Admin/Controller/BusinessAffairsAwardController.class.php
@@ -70,7 +70,7 @@ class BusinessAffairsAwardController extends ThinkController
$amount_end = $_POST['end_amount'];
$busunessData = M("business_affairs_award", "tab_")
- ->where("((start_amount<{$amount_start} and (end_amount >={$amount_start} or end_amount=0)) or (start_amount<{$amount_end} and (end_amount >={$amount_end} or end_amount=0)) or ((end_amount>={$amount_start} or end_amount=0) and (end_amount <={$amount_end} and end_amount!=0)))")
+ ->where("((start_amount<{$amount_start} and (end_amount >{$amount_start} or end_amount=0)) or (start_amount<{$amount_end} and (end_amount >={$amount_end} or end_amount=0)) or ((end_amount>={$amount_start} or end_amount=0) and (end_amount <={$amount_end} and end_amount!=0)))")
->select();
if ($busunessData) {
@@ -110,7 +110,7 @@ class BusinessAffairsAwardController extends ThinkController
$amount_end = $_POST['end_amount'];
$busunessData = M("business_affairs_award", "tab_")
- ->where("id != {$id} and ((start_amount<{$amount_start} and (end_amount >={$amount_start} or end_amount=0)) or (start_amount<{$amount_end} and (end_amount >={$amount_end} or end_amount=0)) or ((end_amount>={$amount_start} or end_amount=0) and (end_amount <={$amount_end} and end_amount!=0)))")
+ ->where("id != {$id} and ((start_amount<{$amount_start} and (end_amount >{$amount_start} or end_amount=0)) or (start_amount<{$amount_end} and (end_amount >={$amount_end} or end_amount=0)) or ((end_amount>={$amount_start} or end_amount=0) and (end_amount <={$amount_end} and end_amount!=0)))")
->select();
if ($busunessData) {
From f675357a2dd60aa37aac4a0dd119701b01fb33ab Mon Sep 17 00:00:00 2001
From: zhengyongxing
Date: Wed, 31 Mar 2021 17:47:47 +0800
Subject: [PATCH 11/16] =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E6=89=93=E6=AC=BE?=
=?UTF-8?q?=E7=B3=BB=E7=BB=9Fbug=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Admin/Controller/BusinessAffairsAwardController.class.php | 4 ++--
Application/Admin/View/BusinessAffairsAward/lists.html | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Application/Admin/Controller/BusinessAffairsAwardController.class.php b/Application/Admin/Controller/BusinessAffairsAwardController.class.php
index 51ca65fbd..0f3f1af55 100644
--- a/Application/Admin/Controller/BusinessAffairsAwardController.class.php
+++ b/Application/Admin/Controller/BusinessAffairsAwardController.class.php
@@ -70,7 +70,7 @@ class BusinessAffairsAwardController extends ThinkController
$amount_end = $_POST['end_amount'];
$busunessData = M("business_affairs_award", "tab_")
- ->where("((start_amount<{$amount_start} and (end_amount >{$amount_start} or end_amount=0)) or (start_amount<{$amount_end} and (end_amount >={$amount_end} or end_amount=0)) or ((end_amount>={$amount_start} or end_amount=0) and (end_amount <={$amount_end} and end_amount!=0)))")
+ ->where("((start_amount<{$amount_start} and (end_amount >{$amount_start} or end_amount=0)) or (start_amount<{$amount_end} and (end_amount >={$amount_end} or end_amount=0)) or ((end_amount>{$amount_start} or end_amount=0) and (end_amount <={$amount_end} and end_amount!=0)))")
->select();
if ($busunessData) {
@@ -110,7 +110,7 @@ class BusinessAffairsAwardController extends ThinkController
$amount_end = $_POST['end_amount'];
$busunessData = M("business_affairs_award", "tab_")
- ->where("id != {$id} and ((start_amount<{$amount_start} and (end_amount >{$amount_start} or end_amount=0)) or (start_amount<{$amount_end} and (end_amount >={$amount_end} or end_amount=0)) or ((end_amount>={$amount_start} or end_amount=0) and (end_amount <={$amount_end} and end_amount!=0)))")
+ ->where("id != {$id} and ((start_amount<{$amount_start} and (end_amount >{$amount_start} or end_amount=0)) or (start_amount<{$amount_end} and (end_amount >={$amount_end} or end_amount=0)) or ((end_amount>{$amount_start} or end_amount=0) and (end_amount <={$amount_end} and end_amount!=0)))")
->select();
if ($busunessData) {
diff --git a/Application/Admin/View/BusinessAffairsAward/lists.html b/Application/Admin/View/BusinessAffairsAward/lists.html
index 9bf92cfd7..7adeb0499 100644
--- a/Application/Admin/View/BusinessAffairsAward/lists.html
+++ b/Application/Admin/View/BusinessAffairsAward/lists.html
@@ -90,9 +90,9 @@
aOh! 暂时还没有内容! |
-
+
- {$data.id} |
+ {$index} |
{$data.start_amount}-{$data.end_amount} |
{$data.ratio}% |
From 860d389700df446e10d6a4cb7396a2b89f012a00 Mon Sep 17 00:00:00 2001
From: zhengyongxing
Date: Wed, 31 Mar 2021 18:10:57 +0800
Subject: [PATCH 12/16] =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E6=89=93=E6=AC=BE?=
=?UTF-8?q?=E7=B3=BB=E7=BB=9Fbug=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../BusinessAffairsAwardController.class.php | 9 ++++++++-
Application/Admin/View/BusinessAffairsAward/lists.html | 10 ++++++++--
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/Application/Admin/Controller/BusinessAffairsAwardController.class.php b/Application/Admin/Controller/BusinessAffairsAwardController.class.php
index 0f3f1af55..10bccd905 100644
--- a/Application/Admin/Controller/BusinessAffairsAwardController.class.php
+++ b/Application/Admin/Controller/BusinessAffairsAwardController.class.php
@@ -36,6 +36,14 @@ class BusinessAffairsAwardController extends ThinkController
}
+ if(IS_ROOT){
+ $this->assign('add_check',true);
+ }else {
+ $exportRule = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME . "_add_check");
+
+ $this->assign('add_check', $this->checkRule($exportRule, array('in', '1,2')));
+ }
+
$count = $this->model->where("1=1")->count();
$page = set_pagination($count, $row,$params);
@@ -53,7 +61,6 @@ class BusinessAffairsAwardController extends ThinkController
{
if(IS_POST) {
-// dump($_POST);die();
if (!$_POST['ratio']) {
$this->ajaxReturn(["msg"=>"请填写抽成比例","code"=>0]);
}
diff --git a/Application/Admin/View/BusinessAffairsAward/lists.html b/Application/Admin/View/BusinessAffairsAward/lists.html
index 7adeb0499..a45d39d3b 100644
--- a/Application/Admin/View/BusinessAffairsAward/lists.html
+++ b/Application/Admin/View/BusinessAffairsAward/lists.html
@@ -38,8 +38,10 @@
@@ -96,8 +98,12 @@
{$data.start_amount}-{$data.end_amount} |
{$data.ratio}% |
+
编辑
删除
+
+ ----
+
|
|
From 0d5ab01f3234657fd35b8fbc23ff6b7b37bc7507 Mon Sep 17 00:00:00 2001
From: zhengyongxing
Date: Wed, 31 Mar 2021 18:27:28 +0800
Subject: [PATCH 13/16] =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E6=89=93=E6=AC=BE?=
=?UTF-8?q?=E7=B3=BB=E7=BB=9Fbug=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../BusinessAffairsAwardController.class.php | 2 +-
.../Admin/Controller/TimingController.class.php | 12 +++++++-----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/Application/Admin/Controller/BusinessAffairsAwardController.class.php b/Application/Admin/Controller/BusinessAffairsAwardController.class.php
index 10bccd905..b398a9e50 100644
--- a/Application/Admin/Controller/BusinessAffairsAwardController.class.php
+++ b/Application/Admin/Controller/BusinessAffairsAwardController.class.php
@@ -214,7 +214,7 @@ class BusinessAffairsAwardController extends ThinkController
$detail .= " ";
}
- $data[$key]['total_quarter_bonus_pool'] = $value['quarter_bonus_pool'] * 0.25;
+ $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)) {
diff --git a/Application/Admin/Controller/TimingController.class.php b/Application/Admin/Controller/TimingController.class.php
index db5119a88..973e5c144 100644
--- a/Application/Admin/Controller/TimingController.class.php
+++ b/Application/Admin/Controller/TimingController.class.php
@@ -1563,6 +1563,7 @@ class TimingController extends AdminController {
echo date("Y-m-d H:i:s")."----------------------商务奖金计算----------------------\n";
+// dump($this->businessAffairRatio(3471300));die();
if (!$_REQUEST['time']) {
@@ -1618,23 +1619,24 @@ class TimingController extends AdminController {
foreach($data as $key => $value) {
- $month_bonus_pool += $this->businessAffairRatio($value['pay_amount']);
+ $month_bonus_pool += $value['pay_amount'];
- $quarter_bonus_pool = $this->businessAffairRatio($value['pay_amount']);
+ $quarter_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))));
- dump($date);
- $quarter_bonus_pool +=
- $this->businessAffairRatio($handleData[$date.$value['game_belong_id'].$value['relation_game_id']]['pay_amount']);
+
+ $quarter_bonus_pool += $handleData[$date.$value['game_belong_id'].$value['relation_game_id']]['pay_amount'];
}
}
}
+ $month_bonus_pool = $this->businessAffairRatio($month_bonus_pool);
+ $quarter_bonus_pool = $this->businessAffairRatio($quarter_bonus_pool);
foreach ($data as $key => $value){
From c1c0e3ac1484d7a121613f16a9cea35ef3e6a186 Mon Sep 17 00:00:00 2001
From: zhengyongxing
Date: Wed, 31 Mar 2021 18:55:36 +0800
Subject: [PATCH 14/16] =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E6=89=93=E6=AC=BE?=
=?UTF-8?q?=E7=B3=BB=E7=BB=9Fbug=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Admin/Controller/TimingController.class.php | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/Application/Admin/Controller/TimingController.class.php b/Application/Admin/Controller/TimingController.class.php
index 973e5c144..10a06aadf 100644
--- a/Application/Admin/Controller/TimingController.class.php
+++ b/Application/Admin/Controller/TimingController.class.php
@@ -1621,7 +1621,7 @@ class TimingController extends AdminController {
$month_bonus_pool += $value['pay_amount'];
- $quarter_bonus_pool = $value['pay_amount'];
+ $quarter_bonus_pool += $value['pay_amount'];
if ($is_hav) {
for($i = (($value['month']%3)?(($value['month']%3)-1):2); $i > 0; $i--) {
@@ -1649,19 +1649,19 @@ class TimingController extends AdminController {
unset($value['year']);
unset($value['month']);
- $value['quarter_award'] = $value['quarter_bonus_pool']*0.25*($becomeTimeList[$value['game_belong_id']]/$becomeTimeCount);
+ $value['quarter_award'] = $value['quarter_bonus_pool']*0.25*(($becomeTimeList[$value['game_belong_id']]?$becomeTimeList[$value['game_belong_id']]:0)/$becomeTimeCount);
$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'=>$becomeTimeList[$value['game_belong_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*(($becomeTimeList[$value['game_belong_id']]?$becomeTimeList[$value['game_belong_id']]:0)/$becomeTimeCount);
+ $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*(($becomeTimeList[$value['game_belong_id']]?$becomeTimeList[$value['game_belong_id']]:0)/$becomeTimeCount);
+ $value['month_award'] = ($value['pay_amount']/$sum_amount)*$value['month_bonus_pool']*0.05;
}
$value['month_award'] = round($value['month_award'],2);
From c772aa68541c80e0bc473df4f4387447dcd4461c Mon Sep 17 00:00:00 2001
From: zhengyongxing
Date: Wed, 31 Mar 2021 19:55:02 +0800
Subject: [PATCH 15/16] =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E6=89=93=E6=AC=BE?=
=?UTF-8?q?=E7=B3=BB=E7=BB=9Fbug=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controller/TimingController.class.php | 22 +++++++++----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/Application/Admin/Controller/TimingController.class.php b/Application/Admin/Controller/TimingController.class.php
index 10a06aadf..7d33a23d4 100644
--- a/Application/Admin/Controller/TimingController.class.php
+++ b/Application/Admin/Controller/TimingController.class.php
@@ -1621,22 +1621,22 @@ class TimingController extends AdminController {
$month_bonus_pool += $value['pay_amount'];
- $quarter_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))));
+// 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))));
+//
+// }
+// }
+ }
- $quarter_bonus_pool += $handleData[$date.$value['game_belong_id'].$value['relation_game_id']]['pay_amount'];
- }
- }
+ $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");
$month_bonus_pool = $this->businessAffairRatio($month_bonus_pool);
- $quarter_bonus_pool = $this->businessAffairRatio($quarter_bonus_pool);
+ $quarter_bonus_pool = $month_bonus_pool + $last_amount;
foreach ($data as $key => $value){
From 99d281b8e179fb5837e458661963cc240b890d2f Mon Sep 17 00:00:00 2001
From: zhengyongxing
Date: Wed, 31 Mar 2021 20:12:11 +0800
Subject: [PATCH 16/16] =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E6=89=93=E6=AC=BE?=
=?UTF-8?q?=E7=B3=BB=E7=BB=9Fbug=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controller/TimingController.class.php | 25 +++++++++++++++----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/Application/Admin/Controller/TimingController.class.php b/Application/Admin/Controller/TimingController.class.php
index 7d33a23d4..d167bf035 100644
--- a/Application/Admin/Controller/TimingController.class.php
+++ b/Application/Admin/Controller/TimingController.class.php
@@ -1576,6 +1576,7 @@ class TimingController extends AdminController {
}
list($becomeTimeList,$becomeTimeCount) = $this->getAffairList(date('Y-m',strtotime(date('Y',$time).'-'.(date('m',$time)-1).'-01')));
+// dump([$becomeTimeList,$becomeTimeCount]);die();
$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'));
@@ -1735,11 +1736,25 @@ class TimingController extends AdminController {
function diffDate($date1,$date2)
{
- $datetime1 = new \DateTime($date1);
- $datetime2 = new \DateTime($date2);
- $interval = $datetime1->diff($datetime2);
- $time = $interval->format('%m');
- return $time;
+ if(strtotime($date1)>strtotime($date2)){
+ $tmp=$date2;
+ $date2=$date1;
+ $date1=$tmp;
+ }
+ list($Y1,$m1,$d1)=explode('-',$date1);
+ list($Y2,$m2,$d2)=explode('-',$date2);
+ $y=$Y2-$Y1;
+ $m=$m2-$m1;
+ $d=$d2-$d1;
+ if($d<0){
+ $d+=(int)date('t',strtotime("-1 month $date2"));
+ $m--;
+ }
+ if($m<0){
+ $m+=12;
+ $y--;
+ }
+ return $m+1;
}
//
|