master
ELF 4 years ago
parent c2da9641f0
commit 550da5cb37

@ -21,13 +21,24 @@ class GameApiController extends Think {
public function verify() public function verify()
{ {
$batch = M('testing_resource_batch', 'tab_')->where(['id' => 3])->find();
$service = new TestingResourceService(); $service = new TestingResourceService();
// $service->verify($batch); $batches = M('testing_resource_batch', 'tab_')->where(['verify_status' => 0])->select();
$service->provide($batch); foreach ($batches as $batch) {
$service->verify($batch);
}
} }
public function provice() { public function provide()
{
$service = new TestingResourceService();
$batches = M('testing_resource_batch', 'tab_')->where(['verify_status' => 1, 'provide_status' => 0])->select();
foreach ($batches as $batch) {
$service->provide($batch);
}
}
public function send()
{
$role = [ $role = [
'role_id' => '6810778', 'role_id' => '6810778',
'user_account' => 'liaojl1130', 'user_account' => 'liaojl1130',

@ -105,22 +105,6 @@ class TestingResourceService
public function provideFromGameCat($order, $role) public function provideFromGameCat($order, $role)
{ {
var_dump([
'roleId' => $role['role_id'],
'amount' => $order['ref_amount'],
'supportItem' => $order['ref_id'],
'supportType' => '0',
'channelUid' => $role['user_account'],
'applyRemark' => $order['remark'],
'applyId' => $order['order_no'],
'device_type' => $role['sdk_version'] == 1 ? 'andriod' : 'ios',
]);
return [
'status' => true,
'message' => '发送成功',
'code' => 1,
];
$gameCatClient = new GameCatClient(); $gameCatClient = new GameCatClient();
$result = $gameCatClient->api('provide', [ $result = $gameCatClient->api('provide', [
'roleId' => $role['role_id'], 'roleId' => $role['role_id'],

@ -29,20 +29,22 @@ class TestingResourceController extends BaseController
$loginPromote = $this->getLoginPromote(); $loginPromote = $this->getLoginPromote();
$conditions = []; $conditions = [];
$subConditions = []; $subConditions = [
'_string' => '1=1'
if ($createTimeStart) { ];
$subConditions['create_time'] = ['egt', strtotime($createTimeStart . ' 00:00:00')];
}
if ($createTimeEnd) {
$subConditions['create_time'] = ['elt', strtotime($createTimeEnd . ' 23:59:59')];
}
/** /**
* @todo 仅有游戏猫 * @todo 仅有游戏猫
*/ */
$strCondition = 'game_id in (229, 230)'; $strCondition = 'game_id in (229, 230)';
if ($createTimeStart) {
$strCondition .= ' and create_time >=' . strtotime($createTimeStart . ' 00:00:00');
}
if ($createTimeEnd) {
$strCondition .= ' and create_time <=' . strtotime($createTimeEnd . ' 23:59:59');
}
$subSql = M('testing_user', 'tab_')->field(['user_id'])->where($subConditions)->select(false); $subSql = M('testing_user', 'tab_')->field(['user_id'])->where($subConditions)->select(false);
$strCondition .= ' and user_id in (' . $subSql . ')'; $strCondition .= ' and user_id in (' . $subSql . ')';
@ -275,10 +277,10 @@ class TestingResourceController extends BaseController
'_string' => 'exists (' . $subSql . ')' '_string' => 'exists (' . $subSql . ')'
]; ];
if ($createTimeStart) { if ($createTimeStart) {
$conditions['create_time'] = ['egt', strtotime($createTimeStart . ' 00:00:00')]; $conditions['_string'] .= ' and create_time >=' . strtotime($createTimeStart . ' 00:00:00');
} }
if ($createTimeEnd) { if ($createTimeEnd) {
$conditions['create_time'] = ['elt', strtotime($createTimeEnd . ' 23:59:59')]; $conditions['_string'] .= ' and create_time <=' . strtotime($createTimeEnd . ' 23:59:59');
} }
if ($verifyStatus != -1) { if ($verifyStatus != -1) {
$conditions['verify_status'] = $verifyStatus; $conditions['verify_status'] = $verifyStatus;
@ -481,6 +483,10 @@ class TestingResourceController extends BaseController
$records = I('records', []); $records = I('records', []);
$loginPromote = $this->getLoginPromote(); $loginPromote = $this->getLoginPromote();
if ($loginPromote['level'] != 1) {
return $this->ajaxReturn(['status' => 0, 'message' => '权限不足']);
}
$resources = []; $resources = [];
/** /**
* @todo 目前仅限游戏猫 * @todo 目前仅限游戏猫
@ -522,6 +528,19 @@ class TestingResourceController extends BaseController
return $this->ajaxReturn(['status' => 0, 'message' => '角色不存在']); return $this->ajaxReturn(['status' => 0, 'message' => '角色不存在']);
} }
$otherRoleBatch = M('testing_resource_batch', 'tab_')
->where([
'user_id' => $user['id'],
'game_id' => $gameId,
'server_id' => $server['server_id'],
'role_id' => ['neq', $roleId],
'verify_status' => ['in', [0, 1]],
])
->find();
if ($otherRoleBatch) {
return $this->ajaxReturn(['status' => 0, 'message' => '每个账号同区服只能申请一个角色']);
}
$testPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $role['promote_id']])->find(); $testPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $role['promote_id']])->find();
if (is_null($testPromote) || !$promoteService->isSubOrSelf($testPromote, $loginPromote)) { if (is_null($testPromote) || !$promoteService->isSubOrSelf($testPromote, $loginPromote)) {
return $this->ajaxReturn(['status' => 0, 'message' => '测试角色所属推广员异常']); return $this->ajaxReturn(['status' => 0, 'message' => '测试角色所属推广员异常']);

@ -112,7 +112,7 @@
<?php endif;?> <?php endif;?>
<a href="{:U('Safe/promoteLogs')}" class="<if condition='CONTROLLER_NAME eq Safe and (ACTION_NAME eq promoteLogs or ACTION_NAME eq promoteLogs or ACTION_NAME eq promoteLogs or ACTION_NAME eq promoteLogs ) '>active</if> ">操作日志</a> <a href="{:U('Safe/promoteLogs')}" class="<if condition='CONTROLLER_NAME eq Safe and (ACTION_NAME eq promoteLogs or ACTION_NAME eq promoteLogs or ACTION_NAME eq promoteLogs or ACTION_NAME eq promoteLogs ) '>active</if> ">操作日志</a>
</div> </div>
<?php if($loginer['level'] < 4):?> <?php if($loginer['level'] == 1):?>
<div class="subNav jssubNav"><i class="prev_icon icon_fenbao"></i><span>测试资源</span><i class="arrow_icon"></i></div> <div class="subNav jssubNav"><i class="prev_icon icon_fenbao"></i><span>测试资源</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent"> <div class="navContent jsnavContent">
<a href="{:U('TestingResource/index')}" class="<if condition='CONTROLLER_NAME eq TestingResource and ACTION_NAME eq index '>active</if> ">测试资源申请</a> <a href="{:U('TestingResource/index')}" class="<if condition='CONTROLLER_NAME eq TestingResource and ACTION_NAME eq index '>active</if> ">测试资源申请</a>

@ -111,14 +111,14 @@
<div class="form-group normal_space fr"> <div class="form-group normal_space fr">
<label class="form-title select-title" style="margin-right: 9px;"></label> <label class="form-title select-title" style="margin-right: 9px;"></label>
<div class="select-time"> <div class="select-time">
<input type="text" id="edate" class="txt" name="end" placeholder="结束时间" value="{:I('end')}" autocomplete="off"> <input type="text" id="edate" class="txt" name="create_time_end" placeholder="结束时间" value="{:I('create_time_end')}" autocomplete="off">
</div> </div>
</div> </div>
<div class="form-group normal_space fr"> <div class="form-group normal_space fr">
<label class="form-title select-title">申请时间:</label> <label class="form-title select-title">创建时间:</label>
<div class="select-time"> <div class="select-time">
<input type="text" id="sdate" class="txt" name="start" placeholder="开始时间" <input type="text" id="sdate" class="txt" name="create_time_start" placeholder="开始时间"
value="{:I('start')}" autocomplete="off"> value="{:I('create_time_start')}" autocomplete="off">
</div> </div>
</div> </div>
<div class="form-group normal_space fr"> <div class="form-group normal_space fr">
@ -126,8 +126,8 @@
placeholder="角色名称" value="{:I('role_name')}" onKeyDown="webchat_chkkeysend(event);"> placeholder="角色名称" value="{:I('role_name')}" onKeyDown="webchat_chkkeysend(event);">
</div> </div>
<div class="form-group normal_space fr"> <div class="form-group normal_space fr">
<input type="text" name="user_account" class="txt normal_txt" id="uid" style="width:128px;" <input type="text" name="account" class="txt normal_txt" id="uid" style="width:128px;"
placeholder="测试账号" value="{:I('user_account')}" onKeyDown="webchat_chkkeysend(event);"> placeholder="测试账号" value="{:I('account')}" onKeyDown="webchat_chkkeysend(event);">
</div> </div>
<div class="form-group normal_space fr"> <div class="form-group normal_space fr">
<span id="server_js"> <span id="server_js">

Loading…
Cancel
Save