getLoginPromote(); if ($loginPromote['rebate_over_perm'] == 0) { return $this->error('无权限操作'); } } public function single() { $this->records('A'); } public function accumulative() { $this->records('C'); } public function daily() { $this->records('B'); } public function firstPay() { $this->records('D'); } public function dayAccumulative() { $this->records('E'); } public function weekly() { $this->records('F'); } public function records($awardType) { $promoteService = new PromoteService(); $loginPromote = $this->getLoginPromote(); $permPromote = $promoteService->getTopPromote($loginPromote); $params = I('get.'); $params['is_export'] = ($params['export'] ?? 0); $params['page'] = ($params['p'] ?? 1); $params['limit'] = ($params['row'] ?? 10); $baseGameId = $params['base_game_id'] ?? 0; $isExport = $params['is_export'] == 1; $service = new GameRebateService(); [$records, $count] = $service->listQuery($params, $awardType, $permPromote); $pageTitle = $service->typeDisplayNames[$awardType]; $pageName = $service->typeNames[$awardType]; if (count($records) > 0) { $records = $service->listRange($records); if ($isExport) { $field = $service->getExportHeadings($awardType); data2csv($records, $pageTitle, $field); exit; } } $pagination = $this->getPagination($count, $params['page'], $params['limit']); $admins = M('ucenter_member', 'sys_')->field(['id', 'username'])->select(); $baseGames = M('base_game', 'tab_')->select(); $gameRepository = new GameRepository(); $this->assign('pageTitle', $pageTitle); $this->assign('pageName', $pageName); $this->assign('awardType', $awardType); $this->assign('servers', $gameRepository->getServersByBaseGameId($baseGameId)); $this->assign('admins', $admins); $this->assign('baseGames', $baseGames); $this->assign('sendStatusList', $service->sendStatusList); $this->assign('reviewStatusList', $service->reviewStatusList); $this->assign('pagination', $pagination); $this->assign('records', $records); $this->display('records'); } public function review() { $ids = I('ids', []); $status = I('status', 0); $loginPromote = $this->getLoginPromote(); try { $handler = []; $handler['type'] = 1; $handler['id'] = $loginPromote['id']; $handler['username'] = $loginPromote['account']; $service = new GameRebateService(); $service->review($ids, $status, $handler); $this->ajaxReturn([ 'status' => 1, 'message' => '操作成功' ]); } catch (\Exception $e) { $this->ajaxReturn([ 'status' => 0, 'message' => $e->getMessage() ]); } } public function getServers() { $gameId = I('game_id', 0); $gameRepository = new GameRepository(); $servers = $gameRepository->getServersByBaseGameId($gameId); return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['servers' => $servers]]); } }