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', ''], ['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']); return $this->success($data); } /** * 保存媒体消耗 */ public function save(Request $request): Response { $data = $request->post(); $this->logic->save($data); return $this->success(); } }