| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- <?php
- namespace app\v1\controller;
- use app\v1\logic\advert\AgentListLogic;
- use app\v1\logic\advert\AgentSiteLogic;
- use app\v1\logic\advert\GamePackageLogic;
- use app\v1\logic\advert\MediaListLogic;
- use app\v1\logic\center\GameGroupLogic;
- use app\v1\logic\center\GameLogic;
- use app\v1\logic\center\GameMainLogic;
- use plugin\saiadmin\app\logic\system\SystemUserLogic;
- use plugin\saiadmin\basic\BaseController;
- use support\Request;
- use support\Response;
- use support\think\Db;
- /**
- * 公共接口管理控制器
- */
- class CommonController extends BaseController
- {
- protected $gameMainLogic;
- protected $gameLogic;
- protected $mediaListLogic;
- protected $agentListLogic;
- protected $systemUserLogic;
- protected $gamePackageLogic;
- protected $agentSiteLogic;
- protected $gameGroupLogic;
- /**
- * 构造函数
- */
- 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();
- $this->gameGroupLogic = new GameGroupLogic();
- }
- // /**
- // * 按照权限获取游戏信息,通过游戏分组
- // */
- // public function getGameListOptions(Request $request): Response
- // {
- // $where = $request->get();
- // $data = $this->gameGroupLogic->getGameListOptions($where);
- // return $this->success($data);
- // }
- /**
- * 获取主游戏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
- */
- 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 getDesignAuthOptions(Request $request): Response
- {
- $data = $this->systemUserLogic->field('id as value, username as label')->where('dept_id', 11)->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);
- }
- /**
- * 获取充值渠道
- */
- public function getPayChannelOptions(Request $request): Response
- {
- $data = Db::connect('db_center')->table('pay_channel')->where('status', 1)->select()->toArray();
- return $this->success($data);
- }
- /**
- * 给游戏分组用的游戏列表
- */
- public function getGameListOptionsByGroup(Request $request): Response
- {
- $where = $request->more([
- ['game_group_id', '']
- ]);
- $data = $this->gameGroupLogic->getGameListOptionsByGroup($where);
- return $this->success($data);
- }
- }
|