From 23643d2e0bdfccbb55dc3e5a27fe808cbf45dc94 Mon Sep 17 00:00:00 2001
From: "elf@home" <360197197@qq.com>
Date: Sun, 31 Jan 2021 19:00:23 +0800
Subject: [PATCH 1/8] =?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/PromoteController.class.php | 2 +-
Application/Admin/View/Promote/edit.html | 16 ++++++++++++++++
.../TestingResourceRepository.class.php | 10 ++++++----
.../Base/Service/PromoteService.class.php | 14 ++++++++++++++
.../Service/TestingResourceService.class.php | 13 ++++++++-----
5 files changed, 45 insertions(+), 10 deletions(-)
diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php
index 58900f04d..76e2b3537 100644
--- a/Application/Admin/Controller/PromoteController.class.php
+++ b/Application/Admin/Controller/PromoteController.class.php
@@ -443,7 +443,7 @@ class PromoteController extends ThinkController
$data['withdraw_show'] = $_POST['withdraw_show'];
$data['withdraw_done'] = $_POST['withdraw_done'];
$data['can_view_recharge'] = $_POST['can_view_recharge'];
-
+ $data['ts_over_apply'] = $_POST['ts_over_apply'] ?? 0;
if (empty($pwd)) {
unset($data['password']);
}
diff --git a/Application/Admin/View/Promote/edit.html b/Application/Admin/View/Promote/edit.html
index 1e32f3003..d8d22e58e 100644
--- a/Application/Admin/View/Promote/edit.html
+++ b/Application/Admin/View/Promote/edit.html
@@ -332,6 +332,22 @@
+
+
+ 测试资源申请权限: |
+
+
+
+
+
+ 开启后该推广员有权限操作整个公会的测试资源查看与申请
+ |
+
+
备注: |
diff --git a/Application/Base/Repository/TestingResourceRepository.class.php b/Application/Base/Repository/TestingResourceRepository.class.php
index 8df219f71..54fb1a003 100644
--- a/Application/Base/Repository/TestingResourceRepository.class.php
+++ b/Application/Base/Repository/TestingResourceRepository.class.php
@@ -95,8 +95,9 @@ class TestingResourceRepository
if (!is_null($promote)) {
$promoteService = new PromoteService();
+ $permissionPromote = $promoteService->getTSPermPromote($promote);
$subSql = M('user', 'tab_')
- ->where('id=tab_testing_resource_batch.user_id and promote_id in (' . $promoteService->subInSql($promote) . ')')
+ ->where('id=tab_testing_resource_batch.user_id and promote_id in (' . $promoteService->subInSql($permissionPromote) . ')')
->select(false);
$conditions['_string'] .= ' and exists (' . $subSql . ')';
@@ -530,14 +531,15 @@ class TestingResourceRepository
$strCondition = '1=1';
$promoteService = new PromoteService();
- if ($promote) {
- $visibleGameIds = $promoteService->getVisibleGameIds($promote);
+ $permissionPromote = $promoteService->getTSPermPromote($promote);
+ if ($permissionPromote) {
+ $visibleGameIds = $promoteService->getVisibleGameIds($permissionPromote);
if (count($visibleGameIds) > 0) {
$strCondition .= ' and game_id in (' . implode(',', $visibleGameIds) . ')';
} else {
$strCondition .= ' and 1=0';
}
- $strCondition .= ' and promote_id in (' . $promoteService->subInSql($promote) . ')';
+ $strCondition .= ' and promote_id in (' . $promoteService->subInSql($permissionPromote) . ')';
}
$gameIds = $this->getHadSettingGameIds();
diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php
index 8bd829d15..0acc1b36d 100644
--- a/Application/Base/Service/PromoteService.class.php
+++ b/Application/Base/Service/PromoteService.class.php
@@ -1337,4 +1337,18 @@ class PromoteService {
$siteConfig['keywords'] = C('channel_index.seo_keyword');
return $siteConfig;
}
+
+ /**
+ * 获取推广员实际拥有的测试资源数据操作范围(测试资源跨部门操作权限)
+ */
+ public function getTSPermPromote($promote)
+ {
+ if (empty($promote)) {
+ return null;
+ }
+ if ($promote['level'] == 2 && $promote['ts_over_apply'] == 1) {
+ return $this->getTopPromote($promote);
+ }
+ return $promote;
+ }
}
\ No newline at end of file
diff --git a/Application/Base/Service/TestingResourceService.class.php b/Application/Base/Service/TestingResourceService.class.php
index 3ff9220af..08a0cc7ab 100644
--- a/Application/Base/Service/TestingResourceService.class.php
+++ b/Application/Base/Service/TestingResourceService.class.php
@@ -205,7 +205,8 @@ class TestingResourceService
$strCondition = '1=1';
if ($promote) {
$promoteService = new PromoteService();
- $strCondition .= ' and promote_id in (' . $promoteService->subInSql($promote) . ')';
+ $permissionPromote = $promoteService->getTSPermPromote($promote);
+ $strCondition .= ' and promote_id in (' . $promoteService->subInSql($permissionPromote) . ')';
}
$users = M('user', 'tab_')->field(['id', 'account'])->where(['account' => ['in', $newAccounts], '_string' => $strCondition])->select();
@@ -293,8 +294,9 @@ class TestingResourceService
}
$promoteService = new PromoteService();
+ $permissionPromote = $promoteService->getTSPermPromote($promote);
$testPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $testingRole['promote_id']])->find();
- if (is_null($testPromote) || ($promote && !$promoteService->isSubOrSelf($testPromote, $promote))) {
+ if (is_null($testPromote) || ($permissionPromote && !$promoteService->isSubOrSelf($testPromote, $permissionPromote))) {
throw new \Exception('测试角色所属推广员异常');
}
@@ -307,7 +309,7 @@ class TestingResourceService
}
$bindPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $bindRole['promote_id']])->find();
- if (is_null($bindPromote) || ($promote && !$promoteService->isSubOrSelf($bindPromote, $promote))) {
+ if (is_null($bindPromote) || ($permissionPromote && !$promoteService->isSubOrSelf($bindPromote, $permissionPromote))) {
throw new \Exception('玩家账号所属推广员异常');
}
@@ -395,6 +397,7 @@ class TestingResourceService
}
$promoteService = new PromoteService();
+ $permissionPromote = $promoteService->getTSPermPromote($promote);
$role = M('user_play_info', 'tab_')
->field(['id', 'role_id', 'promote_id', 'game_id', 'testing_other_quota'])
@@ -418,7 +421,7 @@ class TestingResourceService
}
$testPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $role['promote_id']])->find();
- if (is_null($testPromote) || ($promote && !$promoteService->isSubOrSelf($testPromote, $promote))) {
+ if (is_null($testPromote) || ($permissionPromote && !$promoteService->isSubOrSelf($testPromote, $permissionPromote))) {
throw new \Exception('测试角色所属推广员异常');
}
@@ -433,7 +436,7 @@ class TestingResourceService
}
$bindingRole['binding_time'] = $binding['create_time'];
$bindPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $bindingRole['promote_id']])->find();
- if (is_null($bindPromote) || ($promote && !$promoteService->isSubOrSelf($bindPromote, $promote))) {
+ if (is_null($bindPromote) || ($permissionPromote && !$promoteService->isSubOrSelf($bindPromote, $permissionPromote))) {
throw new \Exception('绑定角色所属推广员异常');
}
/* if ($testPromote['id'] != $bindPromote['id']) {
From a355c2b5794624ca3175c3f6e3e62677e5a726e7 Mon Sep 17 00:00:00 2001
From: ELF <360197197@qq.com>
Date: Mon, 1 Feb 2021 14:14:04 +0800
Subject: [PATCH 2/8] =?UTF-8?q?=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Admin/View/Promote/edit.html | 2 +-
Application/Base/Service/PromoteService.class.php | 2 +-
Application/Base/Service/TestingResourceService.class.php | 7 +++----
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/Application/Admin/View/Promote/edit.html b/Application/Admin/View/Promote/edit.html
index d8d22e58e..2a6ee9578 100644
--- a/Application/Admin/View/Promote/edit.html
+++ b/Application/Admin/View/Promote/edit.html
@@ -332,7 +332,7 @@
|
-
+ 1):?>
测试资源申请权限: |
diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php
index 0acc1b36d..bb7413388 100644
--- a/Application/Base/Service/PromoteService.class.php
+++ b/Application/Base/Service/PromoteService.class.php
@@ -1346,7 +1346,7 @@ class PromoteService {
if (empty($promote)) {
return null;
}
- if ($promote['level'] == 2 && $promote['ts_over_apply'] == 1) {
+ if ($promote['ts_over_apply'] == 1) {
return $this->getTopPromote($promote);
}
return $promote;
diff --git a/Application/Base/Service/TestingResourceService.class.php b/Application/Base/Service/TestingResourceService.class.php
index 08a0cc7ab..08ea5bdf7 100644
--- a/Application/Base/Service/TestingResourceService.class.php
+++ b/Application/Base/Service/TestingResourceService.class.php
@@ -359,7 +359,9 @@ class TestingResourceService
$userAccount = $params['user_account'] ?? '';
$records = $params['records'] ?? [];
- if ($promote && $promote['level'] > 2) {
+ $promoteService = new PromoteService();
+ $permissionPromote = $promoteService->getTSPermPromote($promote);
+ if ($permissionPromote && $permissionPromote['level'] > 2) {
throw new \Exception('权限不足');
}
@@ -396,9 +398,6 @@ class TestingResourceService
throw new \Exception('区服不存在');
}
- $promoteService = new PromoteService();
- $permissionPromote = $promoteService->getTSPermPromote($promote);
-
$role = M('user_play_info', 'tab_')
->field(['id', 'role_id', 'promote_id', 'game_id', 'testing_other_quota'])
->where(['user_id' => $user['id'], 'game_id' => $gameId, 'server_id' => $server['server_id'], 'role_id' => $roleId])
From 2ecaa742d5594e0a7e03b20aad68d97e8592311d Mon Sep 17 00:00:00 2001
From: ELF <360197197@qq.com>
Date: Mon, 1 Feb 2021 14:21:54 +0800
Subject: [PATCH 3/8] =?UTF-8?q?=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Home/View/default/Public/promote_base.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Application/Home/View/default/Public/promote_base.html b/Application/Home/View/default/Public/promote_base.html
index 26d93ead7..b292b77dd 100644
--- a/Application/Home/View/default/Public/promote_base.html
+++ b/Application/Home/View/default/Public/promote_base.html
@@ -125,7 +125,7 @@
操作日志
-
+
测试资源
测试资源申请
From 926b8975f1db5846f47effd15c7b1c16b4a62e1b Mon Sep 17 00:00:00 2001
From: chenzhi
Date: Tue, 2 Feb 2021 14:21:37 +0800
Subject: [PATCH 4/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8D=E8=AF=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Payment/View/ExcelPayment/lists.html | 2 +-
Application/Payment/View/Payment/lists.html | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/Application/Payment/View/ExcelPayment/lists.html b/Application/Payment/View/ExcelPayment/lists.html
index 642808597..22a090899 100644
--- a/Application/Payment/View/ExcelPayment/lists.html
+++ b/Application/Payment/View/ExcelPayment/lists.html
@@ -145,7 +145,7 @@
+
+
+
+
From 0c54e6ecb7b2dad56ab6ba74b73a782b70b96ed7 Mon Sep 17 00:00:00 2001
From: chenzhi
Date: Tue, 2 Feb 2021 16:50:09 +0800
Subject: [PATCH 5/8] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B1=87=E6=80=BB?=
=?UTF-8?q?=E5=8D=95=E5=8F=B7=E6=9F=A5=E6=89=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Payment/Controller/PaymentController.class.php | 10 ++++++++++
Application/Payment/View/Payment/lists.html | 7 ++-----
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/Application/Payment/Controller/PaymentController.class.php b/Application/Payment/Controller/PaymentController.class.php
index 08f953372..bd7294ee4 100644
--- a/Application/Payment/Controller/PaymentController.class.php
+++ b/Application/Payment/Controller/PaymentController.class.php
@@ -73,6 +73,16 @@ class PaymentController extends BaseController
$map['s.verify_time'] = ['ELT', strtotime($_REQUEST['verifytime_end']) + 86399];
}
+ if(isset($_REQUEST['statement_num'])){
+ $statement_num = $_REQUEST['statement_num'];
+ $pool_ids = M("company_statement_pool","tab_")->where("statement_num like '%{$statement_num}%'")->getField("id",true);
+ if(!empty($pool_ids)){
+ $map['s.pool_id'] = ['in', $pool_ids];
+ }else{
+ $map['s.pool_id'] = 0;
+ }
+ }
+
if(isset($_REQUEST['company_type'])){
$map['s.company_type'] = $_REQUEST['company_type'];
}
diff --git a/Application/Payment/View/Payment/lists.html b/Application/Payment/View/Payment/lists.html
index e1b963bf9..7b5ae0576 100644
--- a/Application/Payment/View/Payment/lists.html
+++ b/Application/Payment/View/Payment/lists.html
@@ -181,11 +181,8 @@
-
-
-
-
-
+
+
-
From fa514335cd7fea36ec37000ce29fd0b361235dd0 Mon Sep 17 00:00:00 2001
From: chenzhi
Date: Tue, 2 Feb 2021 16:57:33 +0800
Subject: [PATCH 6/8] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=89=93=E6=AC=BE?=
=?UTF-8?q?=E7=B3=BB=E7=BB=9F=E7=BB=9F=E8=AE=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Payment/View/ExcelPayment/lists.html | 2 +-
Application/Payment/View/Payment/lists.html | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Application/Payment/View/ExcelPayment/lists.html b/Application/Payment/View/ExcelPayment/lists.html
index 22a090899..e4e140aae 100644
--- a/Application/Payment/View/ExcelPayment/lists.html
+++ b/Application/Payment/View/ExcelPayment/lists.html
@@ -258,7 +258,7 @@
|
合计 |
- 打款成功金额: {$money.success_money} / 待打款金额: {$money.statement_money} / 打款失败金额: {$money.error_money}
+ 待打款金额: {$money.statement_money} 打款成功金额: {$money.success_money} 打款失败金额: {$money.error_money}
|
diff --git a/Application/Payment/View/Payment/lists.html b/Application/Payment/View/Payment/lists.html
index 7b5ae0576..e55b532f0 100644
--- a/Application/Payment/View/Payment/lists.html
+++ b/Application/Payment/View/Payment/lists.html
@@ -325,7 +325,7 @@
- 合计 | 待打款金额: {$sum['unpay_amount']|default='0.00'} 打款成功金额: {$sum['pay_amount']|default='0.00'} 打款失败金额: {$sum['faild_pay_amount']|default='0.00'} |
+ 合计 | 待打款金额: {$sum['unpay_amount']|default='0.00'} 打款成功金额: {$sum['pay_amount']|default='0.00'} 打款失败金额: {$sum['faild_pay_amount']|default='0.00'} |
From 35c25119e42cf179a375e1e538756bb201108a64 Mon Sep 17 00:00:00 2001
From: chenzhi
Date: Tue, 2 Feb 2021 17:12:49 +0800
Subject: [PATCH 7/8] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=BA=BF=E4=B8=8B=E6=89=93=E6=AC=BE=E5=90=88?=
=?UTF-8?q?=E8=AE=A1=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../CompanyStatementOfflineController.class.php | 13 ++++++++++---
.../Admin/View/CompanyStatementOffline/lists.html | 11 ++++++++++-
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/Application/Admin/Controller/CompanyStatementOfflineController.class.php b/Application/Admin/Controller/CompanyStatementOfflineController.class.php
index 8879eb6a5..e2bd1aecf 100644
--- a/Application/Admin/Controller/CompanyStatementOfflineController.class.php
+++ b/Application/Admin/Controller/CompanyStatementOfflineController.class.php
@@ -47,6 +47,9 @@ class CompanyStatementOfflineController extends ThinkController
$time_end = strtotime($_REQUEST['time_end'])+ 86399;
$map["_string"] = "(c.statement_begin_time <= {$time_end} ) OR (c.statement_end_time <= {$time_end})";
}
+ if(isset($_REQUEST['pay_status'])){
+ $map['c.pay_status'] = $_REQUEST['pay_status'];
+ }
//其他
if(isset($_REQUEST['company_type'])){
@@ -115,9 +118,12 @@ class CompanyStatementOfflineController extends ThinkController
$v['oplist'] = $this->OpAuth($v);
}
-
- $count = SM("company_statement_info","tab_")->alias("c")->field("count(c.id) count,sum(c.statement_money) statement_money")->join("tab_company_statement_pool as p ON c.pool_id = p.id")->where($map)->find();
- // dd($count);
+ //pay_status
+ $field = "count(c.id) count,IFNULL(SUM(CASE WHEN pay_status = 1 THEN c.statement_money ELSE 0 END),0) as success_money,
+ IFNULL(SUM(CASE WHEN pay_status = 0 THEN c.statement_money ELSE 0 END),0) as statement_money,
+ IFNULL(SUM(CASE WHEN pay_status = -1 THEN c.statement_money ELSE 0 END),0) as error_money";
+ $count = SM("company_statement_info","tab_")->alias("c")->field($field)->join("tab_company_statement_pool as p ON c.pool_id = p.id")->where($map)->find();
+
$params['p'] = $page;
$params['row'] = $row;
$page = set_pagination($count['count'], $row, $params);
@@ -128,6 +134,7 @@ class CompanyStatementOfflineController extends ThinkController
$this->assign('data',$data);
$this->assign('count',$count);
$this->assign('CompanyType',$this->CompanyType);
+ $this->assign("PayStatus", $this->PayStatus);
$this->display();
}
diff --git a/Application/Admin/View/CompanyStatementOffline/lists.html b/Application/Admin/View/CompanyStatementOffline/lists.html
index d7805a15b..b14365a3a 100644
--- a/Application/Admin/View/CompanyStatementOffline/lists.html
+++ b/Application/Admin/View/CompanyStatementOffline/lists.html
@@ -117,6 +117,14 @@
+
+
+