master
ELF 4 years ago
parent e1352fea1e
commit 47ca2f2b9e

@ -295,7 +295,6 @@ class TestingResourceController extends ThinkController
->find();
}
$hasItf = 0;
$servers = [];
@ -464,17 +463,28 @@ class TestingResourceController extends ThinkController
public function getResourceTypes()
{
$gameId = I('game_id', 0);
$testingResourceService = new TestingResourceService();
$resourceTypes = $testingResourceService->getResourceTypes($gameId);
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['resourceTypes' => $resourceTypes]]);
$game = M('game', 'tab_')->field(['id', 'sdk_version'])->where(['id' => $gameId])->find();
try {
$testingResourceService = new TestingResourceService();
$resourceTypes = $testingResourceService->getResourceTypes($game);
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['resourceTypes' => $resourceTypes]]);
} catch (\Throwable $e) {
return $this->ajaxReturn(['status' => 0, 'message' => $e->getMessage(), 'data' => ['resourceTypes' => []]]);
}
}
public function getResources()
{
$typeId = I('type_id', 0);
$testingResourceService = new TestingResourceService();
$resources = $testingResourceService->getResources($typeId);
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['resources' => $resources]]);
$gameId = I('game_id', 0);
$game = M('game', 'tab_')->field(['id', 'sdk_version'])->where(['id' => $gameId])->find();
try {
$testingResourceService = new TestingResourceService();
$resources = $testingResourceService->getResources($game, $typeId);
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['resources' => $resources]]);
} catch (\Throwable $e) {
return $this->ajaxReturn(['status' => 0, 'message' => $e->getMessage(), 'data' => ['resources' => []]]);
}
}
public function exportOrders()

@ -365,7 +365,7 @@ body {
$.ajax({
url: "{:U('getResources')}",
type: "post",
data: { type_id: typeId },
data: { game_id: globalGameId, type_id: typeId },
dataType: 'json',
success: function(result){
if (result.status == 1) {

@ -110,9 +110,9 @@ class JtxcClient
public function getResourceTypes($deviceType)
{
if ($deviceType == 'andriod') {
return ['id' => 1, 'name' => '通用', 'device_type' => 'andriod'];
return [['id' => 1, 'name' => '通用', 'device_type' => 'andriod']];
} elseif ($deviceType == 'ios') {
return ['id' => 2, 'name' => '通用', 'device_type' => 'ios'];
return [['id' => 2, 'name' => '通用', 'device_type' => 'ios']];
}
}

@ -109,9 +109,9 @@ class LsxxClient
public function getResourceTypes($deviceType)
{
if ($deviceType == 'andriod') {
return ['id' => 1, 'name' => '通用', 'device_type' => 'andriod'];
return [['id' => 1, 'name' => '通用', 'device_type' => 'andriod']];
} elseif ($deviceType == 'ios') {
return ['id' => 2, 'name' => '通用', 'device_type' => 'ios'];
return [['id' => 2, 'name' => '通用', 'device_type' => 'ios']];
}
}

@ -34,25 +34,6 @@ class TestingResourceController extends BaseController
$this->assign('records', $records);
$this->display();
}
public function testingUsers()
{
$params = I('get.');
$loginPromote = $this->getLoginPromote();
$repository = new TestingResourceRepository();
$query = $repository->getTestingUsersQuery($params, $loginPromote);
[$testingUsers, $pagination, $count] = $this->paginate($query);
$records = $repository->makeTestingUserRecords($testingUsers);
$this->assign('count', $count);
$this->assign('records', $records);
$this->assign('pagination', $pagination);
$this->display();
}
public function addTestingUsers()
{
@ -223,17 +204,28 @@ class TestingResourceController extends BaseController
public function getResourceTypes()
{
$gameId = I('game_id', 0);
$testingResourceService = new TestingResourceService();
$resourceTypes = $testingResourceService->getResourceTypes($gameId);
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['resourceTypes' => $resourceTypes]]);
$game = M('game', 'tab_')->field(['id', 'sdk_version'])->where(['id' => $gameId])->find();
try {
$testingResourceService = new TestingResourceService();
$resourceTypes = $testingResourceService->getResourceTypes($game);
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['resourceTypes' => $resourceTypes]]);
} catch (\Throwable $e) {
return $this->ajaxReturn(['status' => 0, 'message' => $e->getMessage(), 'data' => ['resourceTypes' => []]]);
}
}
public function getResources()
{
$typeId = I('type_id', 0);
$testingResourceService = new TestingResourceService();
$resources = $testingResourceService->getResources($typeId);
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['resources' => $resources]]);
$gameId = I('game_id', 0);
$game = M('game', 'tab_')->field(['id', 'sdk_version'])->where(['id' => $gameId])->find();
try {
$testingResourceService = new TestingResourceService();
$resources = $testingResourceService->getResources($game, $typeId);
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['resources' => $resources]]);
} catch (\Throwable $e) {
return $this->ajaxReturn(['status' => 0, 'message' => $e->getMessage(), 'data' => ['resources' => []]]);
}
}
public function getUserRoles()

@ -318,7 +318,7 @@
$.ajax({
url: "{:U('getResources')}",
type: "post",
data: { type_id: typeId },
data: { game_id: globalGameId, type_id: typeId },
dataType: 'json',
success: function(result){
if (result.status == 1) {

Loading…
Cancel
Save