master
ELF 4 years ago
parent 401ad97cbc
commit 88402dfac0

@ -212,7 +212,8 @@ class TestingResourceController extends ThinkController
'user_account' => '测试账号',
'user_phone' => '手机号',
'promote_account' => '所属推广员',
'apply_promote_account' => '申请人',
'apply_username' => '申请人',
'verify_admin_username' => '审核人',
'apply_amount' => '申请金额',
'provide_amount' => '发放金额',
'verify_status_text' => '审核状态',
@ -230,10 +231,13 @@ class TestingResourceController extends ThinkController
$gameId = $params['game_id'] ?? 0;
$admins = M('ucenter_member', 'sys_')->field(['id', 'username'])->select();
$this->assign('verifyStatusList', TestingResourceRepository::$verifyStatusList);
$this->assign('provideStatusList', TestingResourceRepository::$provideStatusList);
$this->assign('servers', $gameRepository->getServersByGameId($gameId));
$this->assign('games', $gameRepository->getChoiceGames());
$this->assign('admins', $admins);
$this->assign('count', $count);
$this->assign('_page', $pagination);
$this->assign('records', $records);
@ -266,7 +270,6 @@ class TestingResourceController extends ThinkController
'user_account' => $role['user_account'],
'server_name' => $role['server_name'],
'role_name' => $role['role_name'],
'apply_promote_account' => $applyPromote ? $applyPromote['account'] : '',
'promote_account' => $promote['account'],
'ref_name' => $order['ref_name'],
'ref_amount' => $order['ref_amount'],
@ -337,9 +340,10 @@ class TestingResourceController extends ThinkController
public function doApply()
{
$params = I('post.');
$userAuth = session('user_auth');
try {
$testingResourceService = new TestingResourceService();
$testingResourceService->apply($params);
$testingResourceService->apply($params, null, $userAuth['uid']);
return $this->ajaxReturn(['status' => 1, 'message' => '申请成功,等待审核。']);
} catch (\Throwable $e) {
return $this->ajaxReturn(['status' => 0, 'message' => $e->getMessage()]);
@ -362,11 +366,13 @@ class TestingResourceController extends ThinkController
if (count($batches) == 0) {
return $this->ajaxReturn(['status' => 0, 'message' => '无未审核批次']);
}
$userAuth = session('user_auth');
foreach ($batches as $batch) {
if ($status == 1) {
$service->verify($batch);
$service->verify($batch, $userAuth['uid']);
} elseif ($status == 2) {
$service->verifyRefuse($batch);
$remark = '审核拒绝';
$service->verifyRefuse($batch, $remark, $userAuth['uid']);
}
}
return $this->ajaxReturn(['status' => 1, 'message' => '操作成功']);
@ -533,7 +539,6 @@ class TestingResourceController extends ThinkController
'user_account' => $role ? $role['user_account'] : '',
'server_name' => $role ? $role['server_name'] : '',
'role_name' => $role ? $role['role_name'] : '',
'apply_promote_account' => $applyPromote ? $applyPromote['account'] : '',
'promote_account' => $promote ? $promote['account'] : '',
'ref_name' => $order['ref_name'],
'ref_amount' => $order['ref_amount'],
@ -552,7 +557,6 @@ class TestingResourceController extends ThinkController
'server_name' => '区服名称',
'user_account' => '测试账号',
'role_name' => '角色名称',
'apply_promote_account' => '申请人',
'promote_account' => '所属推广员',
'ref_name' => '资源名称',
'ref_amount' => '资源价值',

@ -143,6 +143,16 @@
<?php endforeach;?>
</select>
</div>
<div class="input-list input-list-promote search_label_rehab">
<select name="provide_status" class="select_gallery" style="width:120px;">
<option value="-1">请选择审核人</option>
<?php foreach($admins as $admin):?>
<option value="<?=$admin['id']?>">
<?=$admin['username']?>
</option>
<?php endforeach;?>
</select>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('TestingResource/batches')}">搜索</a>
<a class="sch-btn" href="{:U('exportOrders', I('get.'))}" style="width: 100px;">导出批次订单</a>
@ -178,7 +188,8 @@
<th>测试账号</th>
<th>手机号</th>
<th>所属推广员</th>
<th>申请人</th>
<th>申请人</th>
<th>审核人</th>
<!-- <th>发放总金额</th> -->
<th>申请金额</th>
<th>发放金额</th>
@ -211,7 +222,8 @@
<td>{$record.user_account}</td>
<td>{$record.user_phone}</td>
<td>{$record.promote_account}</td>
<td>{$record.apply_promote_account}</td>
<td>{$record.apply_username}</td>
<td>{$record.verify_admin_username}</td>
<!-- <td>{$record.history_provide_amount}</td> -->
<td>{$record.apply_amount}</td>
<td>{$record.provide_amount}</td>

@ -45,7 +45,6 @@ body {
<th>玩家账号</th>
<th>区服名称</th>
<th>角色名称</th>
<th>申请人</th>
<th>资源内容</th>
<th>资源价值</th>
<th>申请数量</th>
@ -72,7 +71,6 @@ body {
<td>{$record.user_account}</td>
<td>{$record.server_name}</td>
<td>{$record.role_name}</td>
<td>{$record.apply_promote_account}</td>
<td>{$record.ref_name}</td>
<td>{$record.ref_amount}</td>
<td>{$record.num}</td>

@ -88,6 +88,7 @@ class TestingResourceRepository
$verifyStatus = $params['verify_status'] ?? -1;
$provideStatus = $params['provide_status'] ?? -1;
$account = $params['account'] ?? '';
$adminId = $params['admin_id'] ?? -1;
$conditions = [];
$conditions['_string'] = '1=1';
@ -113,6 +114,9 @@ class TestingResourceRepository
if ($provideStatus != -1) {
$conditions['provide_status'] = $provideStatus;
}
if ($adminId != -1) {
$conditions['verify_admin_id'] = $adminId;
}
if ($gameId) {
$conditions['game_id'] = $gameId;
}
@ -136,6 +140,8 @@ class TestingResourceRepository
$applyPromotes = [];
$users = [];
$promotes = [];
$verifyAdmins = [];
$applyAdmins = [];
if (count($batches) > 0) {
$gameRoleIds = [];
foreach ($batches as $batch) {
@ -153,16 +159,25 @@ class TestingResourceRepository
$applyPromotes = M('promote', 'tab_')->field(['id', 'account'])->where(['id' => ['in', array_column($batches, 'apply_promote_id')]])->select();
$applyPromotes = index_by_column('id', $applyPromotes);
$applyAdminIds = array_column('apply_admin_id', $batches);
$applyAdmins = M('ucenter_member', 'sys_')->field(['id', 'username'])->where(['id' => ['in', $applyAdminIds]])->select();
$applyAdmins = index_by_column('id', $applyAdmins);
if (count($users) > 0) {
$promotes = M('promote', 'tab_')->field(['id', 'account'])->where(['id' => ['in', array_column($users, 'promote_id')]])->select();
$promotes = index_by_column('id', $promotes);
}
$verifyAdminIds = array_column('verify_admin_id', $batches);
$verifyAdmins = M('ucenter_member', 'sys_')->field(['id', 'username'])->where(['id' => ['in', $verifyAdminIds]])->select();
$verifyAdmins = index_by_column('id', $verifyAdmins);
}
return [
'roles' => $roles,
'applyPromotes' => $applyPromotes,
'users' => $users,
'promotes' => $promotes,
'verifyAdmins' => $verifyAdmins,
'applyAdmins' => $applyAdmins,
];
}
@ -173,6 +188,8 @@ class TestingResourceRepository
$applyPromotes = $result['applyPromotes'];
$users = $result['users'];
$promotes = $result['promotes'];
$verifyAdmins = $result['verifyAdmins'];
$applyAdmins = $result['applyAdmins'];
$records = [];
foreach ($batches as $batch) {
@ -181,6 +198,8 @@ class TestingResourceRepository
$user = $users[$batch['user_id']] ?? null;
$applyPromote = $applyPromotes[$batch['apply_promote_id']] ?? null;
$promote = $user && isset($promotes[$user['promote_id']]) ? $promotes[$user['promote_id']] : null;
$verifyAdmin = $verifyAdmins[$batch['verify_admin_id']] ?? null;
$applyAdmin = $applyAdmins[$batch['apply_admin_id']] ?? null;
$records[] = [
'id' => $batch['id'],
'batch_no' => substr($batch['batch_no'], 14),
@ -190,8 +209,9 @@ class TestingResourceRepository
'role_name' => $role ? $role['role_name'] : '--',
'user_account' => $role ?$role['user_account'] : '--',
'user_phone' => $user ? $user['phone'] : '',
'apply_promote_account' => $applyPromote ? $applyPromote['account'] : '',
'apply_username' => $applyPromote ? $applyPromote['account'] . '[推广员]' : ($applyAdmin ? $applyAdmin['username'] . '[管理员]' : ''),
'promote_account' => $promote['account'],
'verify_admin_username' => $verifyAdmin ? $verifyAdmin['username'] : '系統',
// 'history_provide_amount' => 0.00,
'apply_amount' => $batch['apply_amount'],
'provide_amount' => $batch['provide_amount'],

@ -15,7 +15,7 @@ class TestingResourceService
$this->repository = new TestingResourceRepository();
}
public function verify($batch)
public function verify($batch, $verifyAdminId = 0)
{
if ($batch['verify_status'] != 0) {
throw new \Exception('审核状态异常');
@ -35,10 +35,11 @@ class TestingResourceService
$batchData['verify_status'] = 1;
$batchData['verify_remark'] = '审核成功';
$batchData['verify_admin_id'] = $verifyAdminId;
M('testing_resource_batch', 'tab_')->where(['id' => $batch['id']])->save($batchData);
}
public function verifyRefuse($batch, $remark = '审核拒绝')
public function verifyRefuse($batch, $remark = '审核拒绝', $verifyAdminId = 0)
{
if ($batch['verify_status'] != 0) {
throw new \Exception('审核状态异常');
@ -49,6 +50,7 @@ class TestingResourceService
$batchData['update_time'] = time();
$batchData['verify_status'] = 2;
$batchData['verify_remark'] = $remark;
$batchData['verify_admin_id'] = $verifyAdminId;
M('testing_resource_batch', 'tab_')->where(['id' => $batch['id']])->save($batchData);
}
@ -341,7 +343,7 @@ class TestingResourceService
return M('testing_binding', 'tab_')->where(['id' => $bindingId])->delete();
}
public function apply($params, $promote = null)
public function apply($params, $promote = null, $adminId = 0)
{
$gameId = $params['game_id'] ?? 0;
$roleId = $params['role_id'] ?? '';
@ -486,6 +488,7 @@ class TestingResourceService
'role_id' => $roleId,
'server_id' => $serverId,
'apply_promote_id' => $promote ? $promote['id'] : 0,
'apply_admin_id' => $adminId,
'apply_amount' => $amount,
'provide_status' => 0,
'verify_status' => 0,

@ -100,7 +100,6 @@ class TestingResourceController extends BaseController
'user_account' => $role['user_account'],
'server_name' => $role['server_name'],
'role_name' => $role['role_name'],
'apply_promote_account' => $applyPromote ? $applyPromote['account'] : '',
'promote_account' => $promote['account'],
'ref_name' => $order['ref_name'],
'ref_amount' => $order['ref_amount'],

@ -119,7 +119,6 @@
<th>测试账号</th>
<th>手机号</th>
<th>所属推广员</th>
<th>申请人</th>
<!-- <th>发放总金额</th> -->
<th>申请金额</th>
<th>发放金额</th>
@ -147,7 +146,6 @@
<td>{$record.user_account}</td>
<td>{$record.user_phone}</td>
<td>{$record.promote_account}</td>
<td>{$record.apply_promote_account}</td>
<!-- <td>{$record.history_provide_amount}</td> -->
<td>{$record.apply_amount}</td>
<td>{$record.provide_amount}</td>

@ -106,7 +106,6 @@
<th>玩家账号</th>
<th>区服名称</th>
<th>角色名称</th>
<th>申请人</th>
<th>资源内容</th>
<th>资源价值</th>
<th>申请数量</th>
@ -129,7 +128,6 @@
<td>{$record.user_account}</td>
<td>{$record.server_name}</td>
<td>{$record.role_name}</td>
<td>{$record.apply_promote_account}</td>
<td>{$record.ref_name}</td>
<td>{$record.ref_amount}</td>
<td>{$record.num}</td>

Loading…
Cancel
Save