Merge pull request '优化' (#140) from feature/testing_resource_permission into release

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/140
master
廖金灵 4 years ago
commit 9199b4c9a8

@ -332,7 +332,7 @@
</span> </span>
</td> </td>
</tr> </tr>
<?php if($data['level'] == 2):?> <?php if($data['level'] > 1):?>
<tr> <tr>
<td class="l">测试资源申请权限:</td> <td class="l">测试资源申请权限:</td>
<td class="r table_radio"> <td class="r table_radio">

@ -1346,7 +1346,7 @@ class PromoteService {
if (empty($promote)) { if (empty($promote)) {
return null; return null;
} }
if ($promote['level'] == 2 && $promote['ts_over_apply'] == 1) { if ($promote['ts_over_apply'] == 1) {
return $this->getTopPromote($promote); return $this->getTopPromote($promote);
} }
return $promote; return $promote;

@ -359,7 +359,9 @@ class TestingResourceService
$userAccount = $params['user_account'] ?? ''; $userAccount = $params['user_account'] ?? '';
$records = $params['records'] ?? []; $records = $params['records'] ?? [];
if ($promote && $promote['level'] > 2) { $promoteService = new PromoteService();
$permissionPromote = $promoteService->getTSPermPromote($promote);
if ($permissionPromote && $permissionPromote['level'] > 2) {
throw new \Exception('权限不足'); throw new \Exception('权限不足');
} }
@ -396,9 +398,6 @@ class TestingResourceService
throw new \Exception('区服不存在'); throw new \Exception('区服不存在');
} }
$promoteService = new PromoteService();
$permissionPromote = $promoteService->getTSPermPromote($promote);
$role = M('user_play_info', 'tab_') $role = M('user_play_info', 'tab_')
->field(['id', 'role_id', 'promote_id', 'game_id', 'testing_other_quota']) ->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]) ->where(['user_id' => $user['id'], 'game_id' => $gameId, 'server_id' => $server['server_id'], 'role_id' => $roleId])

Loading…
Cancel
Save