| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- namespace app\v1\controller\advert;
- use app\v1\logic\advert\AgentListLogic;
- use app\v1\logic\advert\AgentSiteLogic;
- use plugin\saiadmin\basic\BaseController;
- use app\v1\logic\advert\MediaCostLogic;
- use app\v1\logic\center\GameLogic;
- use app\v1\validate\advert\MediaCostValidate;
- use plugin\saiadmin\app\logic\system\SystemUserLogic;
- use support\Request;
- use support\Response;
- /**
- * 媒体消耗控制器
- */
- class MediaCostController extends BaseController
- {
- protected $agentSiteLogic;
- protected $agentListLogic;
- protected $gameLogic;
- protected $systemUserLogic;
- /**
- * 构造函数
- */
- public function __construct()
- {
- $this->logic = new MediaCostLogic();
- $this->validate = new MediaCostValidate;
- parent::__construct();
- $this->agentSiteLogic = new AgentSiteLogic();
- $this->agentListLogic = new AgentListLogic();
- $this->gameLogic = new GameLogic();
- $this->systemUserLogic = new SystemUserLogic();
- }
- /**
- * 数据列表
- * @param Request $request
- * @return Response
- */
- public function index(Request $request): Response
- {
- $where = $request->more([
- ['tdate', ''],
- ['game_id', ''],
- ['media_id', ''],
- ['advertiser_id', ''],
- ['agent_id', ''],
- ['site_id', ''],
- ['auth_id', ''],
- ['add_type', ''],
- ['remark', ''],
- ['create_time', ''],
- ]);
- $query = $this->logic->search($where);
-
-
- // 游戏权限过滤
- if($request->get('auth_game_list')){
- $gameIds = explode(',', $request->get('auth_game_list'));
- $query->whereIn('game_id', $gameIds);
- }
- $data = $this->logic->getList($query)['data'];
- $data = $this->logic->trandformListColumn($data, ['site', 'agent', 'game', 'auth','media']);
-
- return $this->success($data);
- }
- }
|