diff --git a/Application/Admin/Controller/PresidentDepositController.class.php b/Application/Admin/Controller/PresidentDepositController.class.php index 4e6f34fe5..aacd4d736 100644 --- a/Application/Admin/Controller/PresidentDepositController.class.php +++ b/Application/Admin/Controller/PresidentDepositController.class.php @@ -53,6 +53,8 @@ class PresidentDepositController extends ThinkController $promotes = $this->mergeOneReletions('company', $promotes, $relationQuery, 'company_id', 'id'); $relationQuery = M('president_deposit', 'tab_'); $promotes = $this->mergeOneReletions('presidentDeposit', $promotes, $relationQuery, 'id', 'promote_id'); + $relationQuery = M('promote_belong', 'tab_')->field(['verify_time', 'promote_id']); + $promotes = $this->mergeOneReletions('promoteBelong', $promotes, $relationQuery, 'id', 'promote_id'); /*echo '<pre>'; var_dump($promotes); echo '</pre>'; diff --git a/Application/Admin/View/PresidentDeposit/records.html b/Application/Admin/View/PresidentDeposit/records.html index bd2a9e2d2..4bb45fbd0 100644 --- a/Application/Admin/View/PresidentDeposit/records.html +++ b/Application/Admin/View/PresidentDeposit/records.html @@ -155,7 +155,7 @@ <td><?=$payTypes[$data['presidentDeposit']['pay_type']] ?? '--'?></td> <td><?=date('Y-m-d H:i:s', $data['presidentDeposit']['create_time'])?></td> <td><?=$data['presidentDeposit']['amount']?></td> - <td><?=date('Y-m-d H:i:s', $data['presidentDeposit']['verify_time'])?></td> + <td><?=date('Y-m-d H:i:s', $data['promoteBelong']['verify_time'])?></td> <td><?=$statusList[$data['presidentDeposit']['status']]?></td> <td><?=date('Y-m-d H:i:s', $data['presidentDeposit']['pay_confirm_time'])?></td> <td> diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index 1361d41af..d43a27d0d 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -1004,4 +1004,19 @@ class PromoteService { } return null; } + + public function canPresidentApplyGame($promote) + { + $topPromote = $this->getTopPromote($promote); + if (in_array($topPromote['company_belong'], [1, 2])) { + $record = M('president_deposit', 'tab_')->where(['promote_id' => $topPromote['id']])->find(); + if (!$record) { + return false; + } + if ($record['status'] != 1) { + return false; + } + } + return true; + } } \ No newline at end of file diff --git a/Application/Home/Controller/ApplyController.class.php b/Application/Home/Controller/ApplyController.class.php index a50f68bb1..77d5d3550 100644 --- a/Application/Home/Controller/ApplyController.class.php +++ b/Application/Home/Controller/ApplyController.class.php @@ -7,6 +7,7 @@ use Admin\Model\ApplyModel; use Think\Model; use Base\Facade\Request; use Base\Service\ApplyService; +use Base\Service\PromoteService; /** @@ -1781,6 +1782,16 @@ class ApplyController extends BaseController ]); } + $promoteService = new PromoteService(); + if (!$promoteService->canPresidentApplyGame($promote)) { + $this->ajaxReturn([ + 'status' => 0, + 'message' => '请联系市场专员开启', + 'data' => [ + ] + ]); + } + $icon = Request::getHost() . '/' . get_cover($game['icon'], 'path'); $applyService = new ApplyService(); @@ -1811,6 +1822,7 @@ class ApplyController extends BaseController if ($promoteId == 0) { $promoteId = $promote['id']; } + $apply = M('apply', 'tab_')->where(['promote_id' => $promoteId, 'game_id' => $gameId])->find(); $game = M('game', 'tab_')->field(['icon'])->where(['id' => $gameId])->find(); if ($apply == null) { @@ -1822,6 +1834,16 @@ class ApplyController extends BaseController ]); } + $promoteService = new PromoteService(); + if (!$promoteService->canPresidentApplyGame($promote)) { + $this->ajaxReturn([ + 'status' => 0, + 'message' => '请联系市场专员开启', + 'data' => [ + ] + ]); + } + $icon = Request::getHost() . '/' . get_cover($game['icon'], 'path'); $applyService = new ApplyService(); diff --git a/Data/update.sql b/Data/update.sql index 6c14c5713..f78d43196 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1175,7 +1175,6 @@ CREATE TABLE `tab_president_deposit` ( `pay_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '押金付款方式', `pay_way` tinyint(1) NOT NULL DEFAULT '0' COMMENT '付款方式', `pay_account` varchar(60) NOT NULL DEFAULT '' COMMENT '付款账号', - `verify_time` int(10) NOT NULL DEFAULT '0' COMMENT '审核时间', `pay_confirm_time` int(10) NOT NULL DEFAULT '0' COMMENT '押金确认时间', `refund_time` int(10) NOT NULL DEFAULT '0' COMMENT '退款时间', `create_time` int(10) NOT NULL DEFAULT '0' COMMENT '添加时间',