| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- <?php
- namespace app\v1\controller;
- use app\v1\logic\advert\AgentListLogic;
- use app\v1\logic\advert\AgentSiteLogic;
- use app\v1\logic\advert\MediaListLogic;
- use app\v1\logic\center\GameLogic;
- use plugin\saiadmin\basic\BaseController;
- use app\v1\logic\center\GameMainLogic;
- use app\v1\logic\gameLog\GamePackageLogic;
- use plugin\saiadmin\app\logic\system\SystemUserLogic;
- use support\Request;
- use support\Response;
- /**
- * 公共接口管理控制器
- */
- class CommonController extends BaseController
- {
- protected $gameMainLogic;
- protected $gameLogic;
- protected $mediaListLogic;
- protected $agentListLogic;
- protected $systemUserLogic;
- protected $gamePackageLogic;
- protected $agentSiteLogic;
- /**
- * 构造函数
- */
- public function __construct()
- {
- parent::__construct();
- $this->gameMainLogic = new GameMainLogic();
- $this->gameLogic = new GameLogic();
- $this->mediaListLogic = new MediaListLogic();
- $this->agentListLogic = new AgentListLogic();
- $this->systemUserLogic = new SystemUserLogic();
- $this->gamePackageLogic = new GamePackageLogic();
- $this->agentSiteLogic = new AgentSiteLogic();
- }
-
- /**
- * 获取主游戏options列表
- * @return Response
- */
- public function getMainGameOptions(Request $request): Response
- {
- $data = $this->gameMainLogic->getMainGameOptions();
- return $this->success($data);
- }
- /**
- * 获取子游戏options列表(有权限)
- * @return Response
- */
- public function getGameOptions(Request $request): Response
- {
- $where = $request->get();
- $data = $this->gameLogic->getGameOptions($where);
- return $this->success($data);
- }
- /**
- * 获取子游戏options列表(无权限)
- * @return Response
- */
- public function getGameOptionsNoAuth(Request $request): Response
- {
- $where = $request->get();
- $data = $this->gameLogic->getGameOptionsNoAuth($where);
- return $this->success($data);
- }
- /**
- * 获取游戏options列表(有权限)
- * @return Response
- */
- public function getTreeGameOptions(Request $request): Response
- {
- $where = $request->get();
- $data = $this->gameLogic->getGameListByPermission($where);
- return $this->success($data);
- }
- /**
- * 获取树形游戏options列表(无权限)
- * @return Response
- */
- public function getGameListTreeNoAuth(Request $request): Response
- {
- $where = $request->get();
- $data = $this->gameLogic->getGameListTreeNoAuth($where);
- return $this->success($data);
- }
- /**
- * 获取树形游戏options列表(有权限)
- * @return Response
- */
- public function getGameListTree(Request $request): Response
- {
- $where = $request->get();
- $data = $this->gameLogic->getGameListTree($where);
- return $this->success($data);
- }
- /**
- * 查询媒体列表Options
- */
- public function getMediaOptions(Request $request): Response
- {
- $data = $this->mediaListLogic->getMediaOptions();
- $data = $data->toArray();
-
- return $this->success($data);
- }
- /**
- * 查询渠道列表Options
- */
- public function getAgentOptions(Request $request): Response
- {
- $data = $this->agentListLogic->getAgentOptions();
- return $this->success($data);
- }
- /**
- * 后台归属人列表Options
- */
- public function getAuthOptions(Request $request): Response
- {
- $data = $this->systemUserLogic->field('id as value, username as label')->select()->toArray();
- return $this->success($data);
- }
- /**
- * 获取母包列表Options
- */
- public function getPackageOptions(Request $request): Response
- {
- $where = $request->get();
- $data = $this->gamePackageLogic->getPackageOptions($where);
- return $this->success($data);
- }
- /**
- * 获取广告位options
- */
- public function getAgentSiteOptions(Request $request): Response
- {
- $data = $this->agentSiteLogic->getAgentSiteOptions();
- return $this->success($data);
- }
- }
|