|
|
|
@ -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()
|
|
|
|
|