master
ELF 4 years ago
parent 66bffbff99
commit 247c4e9aae

@ -180,7 +180,7 @@ class TestingResourceController extends BaseController
'role_name' => $role['role_name'],
'bind_user_account' => $bindingRole ? $bindingRole['user_account'] : '',
'bind_role_name' => $bindingRole ? $bindingRole['role_name'] : '',
'base_quota' => $binding ? $binding['base_quota'] : 0,
'base_quota' => $binding ? $binding['base_quota'] : 300,
'other_quota' => $binding ? $binding['other_quota'] : 0,
'quota' => $bindingRole && isset($spendItems[$bindingRole['game_role_id']]) ? $spendItems[$bindingRole['game_role_id']] : 0,
'verify_amount' => $verifyRecords[$role['game_role_id']] ?? 0,
@ -487,9 +487,9 @@ class TestingResourceController extends BaseController
}
$binding = M('testing_binding', 'tab_')->where(['game_id' => $gameId, 'role_id' => $roleId])->find();
if (is_null($binding)) {
/* if (is_null($binding)) {
return $this->ajaxReturn(['status' => 0, 'message' => '该角色未绑定玩家角色']);
}
} */
$user = M('user', 'tab_')->field(['id', 'promote_id'])->where(['account' => $userAccount])->find();
if (is_null($user)) {
@ -508,7 +508,7 @@ class TestingResourceController extends BaseController
$promoteService = new PromoteService();
$role = M('user_play_info', 'tab_')
->field(['id', 'role_id', 'promote_id'])
->field(['id', 'role_id', 'promote_id', 'game_id'])
->where(['user_id' => $user['id'], 'game_id' => $gameId, 'server_id' => $server['server_id'], 'role_id' => $roleId])
->find();
if (is_null($role)) {
@ -519,20 +519,22 @@ class TestingResourceController extends BaseController
return $this->ajaxReturn(['status' => 0, 'message' => '测试角色所属推广员异常']);
}
$bindingRole = M('user_play_info', 'tab_')
->field(['id', 'role_id', 'user_id', 'promote_id', 'game_id'])
->where(['game_id' => $gameId, 'role_id' => $binding['bind_role_id']])
->find();
if (is_null($bindingRole)) {
return $this->ajaxReturn(['status' => 0, 'message' => '绑定玩家角色不存在']);
}
$bindPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $bindingRole['promote_id']])->find();
if (is_null($bindPromote) || !$promoteService->isSubOrSelf($bindPromote, $loginPromote)) {
return $this->ajaxReturn(['status' => 0, 'message' => '绑定角色所属推广员异常']);
}
if ($testPromote['id'] != $bindPromote['id']) {
return $this->ajaxReturn(['status' => 0, 'message' => '测试账号与玩家账号所属推广员不同']);
$bindingRole = null;
if ($binding) {
$bindingRole = M('user_play_info', 'tab_')
->field(['id', 'role_id', 'user_id', 'promote_id', 'game_id'])
->where(['game_id' => $gameId, 'role_id' => $binding['bind_role_id']])
->find();
if (is_null($bindingRole)) {
return $this->ajaxReturn(['status' => 0, 'message' => '绑定玩家角色不存在']);
}
$bindPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $bindingRole['promote_id']])->find();
if (is_null($bindPromote) || !$promoteService->isSubOrSelf($bindPromote, $loginPromote)) {
return $this->ajaxReturn(['status' => 0, 'message' => '绑定角色所属推广员异常']);
}
/* if ($testPromote['id'] != $bindPromote['id']) {
return $this->ajaxReturn(['status' => 0, 'message' => '测试账号与玩家账号所属推广员不同']);
} */
}
$amount = 0;
@ -553,7 +555,7 @@ class TestingResourceController extends BaseController
}
}
$remainQuota = $this->getRemainQuota($bindingRole['game_id'], $bindingRole['role_id'], $role['role_id']);
$remainQuota = $this->getRemainQuota($role['game_id'], $bindingRole ? $bindingRole['role_id'] : null, $role['role_id']);
if ($amount > $remainQuota) {
return $this->ajaxReturn(['status' => 0, 'message' => '额度不足']);
}
@ -643,9 +645,9 @@ class TestingResourceController extends BaseController
return $this->ajaxReturn(['status' => 0, 'message' => '玩家账号所属推广员异常']);
}
if ($testPromote['id'] != $bindPromote['id']) {
/* if ($testPromote['id'] != $bindPromote['id']) {
return $this->ajaxReturn(['status' => 0, 'message' => '玩家账号与测试账号非同一推广员']);
}
} */
$bindIsTesting = M('testing_user', 'tab_')->where(['user_id' => $bindRole['user_id']])->find();
if ($bindIsTesting) {

@ -181,8 +181,8 @@
<th>角色名称</th>
<th>绑定账号</th>
<th>绑定角色</th>
<!-- <th>初始额度</th> -->
<!-- <th>额外额度</th> -->
<th>初始额度</th>
<th>额外额度</th>
<th>累计额度</th>
<th>待审核金额</th>
<th>累计发放资源</th>
@ -214,8 +214,8 @@
<td>{$record.role_name}</td>
<td>{$record.bind_user_account}</td>
<td>{$record.bind_role_name}</td>
<!-- <td>{$record.base_quota}</td> -->
<!-- <td>{$record.other_quota}</td> -->
<td>{$record.base_quota}</td>
<td>{$record.other_quota}</td>
<td>{$record.quota}</td>
<td>{$record.verify_amount}</td>
<td>{$record.provide_amount}</td>

Loading…
Cancel
Save