all(),[ 'keyword' => 'nullable|string', 'is_select' => 'nullable|integer' // 是否下拉列表 ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $keyword = $request->input('keyword'); $isSelect = $request->input('is_select', 0); $page = $request->input('page', 1); $pageSize = $request->input('page_size', 20); $sysGroupId = $request->input('sys_group_id'); $adminId = $request->input('admin_id'); $isSystemAdmin = $request->input('is_system_admin'); if (!$isSelect) { list($list, $total) = PitcherService::wxAccountList( $keyword, $isSelect, $page, $pageSize, $sysGroupId, $adminId, $isSystemAdmin ); return self::returnPageValue($list, $total, $pageSize, $page); } else { $res = PitcherService::wxAccountList($keyword, $isSelect, $page, $pageSize, $sysGroupId, $adminId, $isSystemAdmin); return self::returnValue($res); } } /** * 公众号列表 * @param Request $request * @return array */ public function officialAccountsList(Request $request) { $validator = \Validator::make($request->all(),[ 'keyword' => 'nullable|string', 'is_select' => 'nullable|integer' // 是否下拉列表 ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $keyword = $request->input('keyword'); $isSelect = $request->input('is_select', 0); $page = $request->input('page', 1); $pageSize = $request->input('page_size', 20); $sysGroupId = $request->input('sys_group_id'); $adminId = $request->input('admin_id'); $isSystemAdmin = $request->input('is_system_admin'); if (!$isSelect) { list($list, $total) = PitcherService::officialAccountsList( $keyword, $isSelect, $page, $pageSize, $sysGroupId, $adminId, $isSystemAdmin ); return self::returnPageValue($list, $total, $pageSize, $page); } else { $res = PitcherService::officialAccountsList($keyword, $isSelect, $page, $pageSize, $sysGroupId, $adminId, $isSystemAdmin); return self::returnValue($res); } } /** * 短剧列表 * @return array */ public function dramaList(Request $request) { $validator = \Validator::make($request->all(),[ 'keyword' => 'nullable|string', 'is_select' => 'nullable|integer' // 是否下拉列表 ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $keyword = $request->input('keyword'); $isSelect = $request->input('is_select', 1); $page = $request->input('page', 1); $pageSize = $request->input('page_size', 20); $sysGroupId = $request->input('sys_group_id'); if (!$isSelect) { list($list, $total) = PitcherService::dramaList($keyword, $isSelect, $page, $pageSize, $sysGroupId); return self::returnPageValue($list, $total, $pageSize, $page); } else { $res = PitcherService::dramaList($keyword, $isSelect, $page, $pageSize, $sysGroupId); return self::returnValue($res); } } /** * 投手列表 * @param Request $request * @return array */ public function pitcherList(Request $request) { $validator = \Validator::make($request->all(),[ // 'corp_id' => 'nullable|string', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } // $corpId = $request->input('corp_id'); $sysGroupId = $request->input('sys_group_id'); $res = PitcherService::pitcherList($sysGroupId); return self::returnValue($res); } /** * 绑定投手 * @param Request $request * @return array */ public function bind(Request $request) { $validator = \Validator::make($request->all(),[ 'app_id' => 'required|string', 'drama_id' => 'required|integer', 'user_id' => 'required|integer', 'start_date' => 'required|date', 'end_date' => 'required|date', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $appId = $request->input('app_id'); $dramaId = $request->input('drama_id'); $userId = $request->input('user_id'); $startDate = $request->input('start_date'); $endDate = $request->input('end_date'); $sysGroupId= $request->input('sys_group_id'); list($res, $code) = PitcherService::bind($appId, $dramaId, $userId, $startDate, $endDate, $sysGroupId); return self::returnValue($res, $code); } /** * 投手绑定数据 * @param Request $request * @return array */ public function index(Request $request) { $validator = \Validator::make($request->all(),[ 'app_id' => 'required|string', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $appId = $request->input('app_id'); $page = $request->input('page', 1); $pageSize = $request->input('page_size', 20); $sysGroupId = $request->input('sys_group_id'); list($list, $total) = PitcherService::index($appId, $page, $pageSize, $sysGroupId); return self::returnPageValue($list, $total, $pageSize, $page); } /** * 绑定关系数据编辑 * @param Request $request * @return array */ public function relaEdit(Request $request) { $validator = \Validator::make($request->all(),[ 'rela_id' => 'required|integer', 'drama_id' => 'required|integer', 'user_id' => 'required|integer', 'start_date' => 'required|date', 'end_date' => 'required|date', 'enable' => 'required|integer' ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $relaId = $request->input('rela_id'); $dramaId = $request->input('drama_id'); $userId = $request->input('user_id'); $startDate = $request->input('start_date'); $endDate = $request->input('end_date'); $enable = $request->input('enable'); list($res, $code) = PitcherService::relaEdit($relaId, $dramaId, $userId, $startDate, $endDate, $enable); return self::returnValue($res, $code); } /** * 剧集添加 * @return array */ public function dramaAdd(Request $request) { $validator = \Validator::make($request->all(),[ 'drama_name' => 'required|string' ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $dramaName = $request->input('drama_name'); $sysGroupId = $request->input('sys_group_id'); $errno = 0; $res = PitcherService::dramaAdd($dramaName, $sysGroupId, $errno); return self::returnValue($res, $errno); } /** * 剧集编辑 * @return array */ public function dramaEdit(Request $request) { $validator = \Validator::make($request->all(),[ 'drama_id' => 'required|integer', 'drama_name' => 'required|string', 'enable' => 'required|integer' ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $dramaId = $request->input('drama_id'); $dramaName = $request->input('drama_name'); $enable = $request->input('enable'); list($res, $code) = PitcherService::dramaEdit($dramaId, $dramaName, $enable); return self::returnValue($res, $code); } /** * 公众号设置回传方式 */ public function setReportRule(Request $request) { $validator = \Validator::make($request->all(),[ 'app_ids' => 'required|array', 'report_type' => 'required|integer', 'enable' => 'required|in:0,1', 'if_all' => 'nullable|in:0,1', 'purchase_enable' => 'required|in:0,1', 'miss_enable' => 'required|in:0,1', 'miss_setvale' => 'required|integer', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $app_ids = $request->input('app_ids'); $report_type = $request->input('report_type'); $enable = $request->input('enable'); $if_all = $request->input('if_all'); $purchase_enable = $request->input('purchase_enable'); $miss_enable = $request->input('miss_enable'); $miss_setvale = $request->input('miss_setvale'); list($res, $code) = PitcherService::setReportRule($app_ids, $report_type, $enable, $purchase_enable, $miss_enable, $miss_setvale, $if_all); return self::returnValue($res, $code); } /** * 回传规则列表 */ public function reportRuleList(Request $request) { $res = PitcherService::reportRuleList(); return self::returnValue($res); } /** * 公众号绑定数据源和企微 */ public function setAccountReportConf(Request $request) { $validator = \Validator::make($request->all(),[ 'app_id' => 'required|string', 'user_action_set_id' => 'required', 'corpid' => 'required', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $app_id = $request->input('app_id'); $user_action_set_id = $request->input('user_action_set_id'); $corp_id = $request->input('corpid'); $channel = $request->input('channel'); $isProvisionalStat = $request->input('is_provisional_stat', 0); $sysGroupId = $request->input('sys_group_id'); $res = PitcherService::setAccountReportConf($app_id, $user_action_set_id, $corp_id, $channel, $isProvisionalStat, $sysGroupId); return self::returnValue($res); } /** * 企微下拉列表 */ public function getCorpIdList(Request $request) { $res = PitcherService::getCorpIdList(); return self::returnValue($res); } public function adqAccountList(Request $request) { $validator = \Validator::make($request->all(),[ 'keyword' => 'nullable|string', 'is_select' => 'nullable|integer' // 是否下拉列表 ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $keyword = $request->input('keyword'); $isSelect = $request->input('is_select', 0); $page = $request->input('page', 1); $pageSize = $request->input('page_size', 20); $sysGroupId = $request->input('sys_group_id'); $adminId = $request->input('admin_id'); $isSystemAdmin = $request->input('is_system_admin'); if(!$isSelect) { list($list, $total) = PitcherService::adqAccountList( $keyword, $isSelect, $page, $pageSize, $sysGroupId, $adminId, $isSystemAdmin ); return self::returnPageValue($list, $total, $pageSize, $page); } else { $res = PitcherService::adqAccountList($keyword, $isSelect, $page, $pageSize, $sysGroupId, $adminId, $isSystemAdmin); return self::returnValue($res); } } /** * 投手绑定数据 * @param Request $request * @return array */ public function adqPitcherIndex(Request $request) { $validator = \Validator::make($request->all(),[ 'account_id' => 'required|string', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $accountId= $request->input('account_id'); $page = $request->input('page', 1); $pageSize = $request->input('page_size', 20); $sysGroupId=$request->input('sys_group_id'); list($list, $total) = PitcherService::adqPitcherIndex($accountId, $page, $pageSize, $sysGroupId); return self::returnPageValue($list, $total, $pageSize, $page); } /** * 绑定投手 * @param Request $request * @return array */ public function adqBindPitcher(Request $request) { $validator = \Validator::make($request->all(),[ 'account_id' => 'required|string', 'drama_id' => 'required|integer', 'user_id' => 'required|integer', 'start_date' => 'required|date', 'end_date' => 'required|date', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $accountId = $request->input('account_id'); $dramaId = $request->input('drama_id'); $userId = $request->input('user_id'); $startDate = $request->input('start_date'); $endDate = $request->input('end_date'); $sysGroupId= $request->input('sys_group_id'); list($res, $code) = PitcherService::adqBindPitcher($accountId, $dramaId, $userId, $startDate, $endDate, $sysGroupId); return self::returnValue($res, $code); } /** * 绑定关系数据编辑 * @param Request $request * @return array */ public function adqEditPitcher(Request $request) { $validator = \Validator::make($request->all(),[ 'rela_id' => 'required|integer', 'drama_id' => 'required|integer', 'user_id' => 'required|integer', 'start_date' => 'required|date', 'end_date' => 'required|date', 'enable' => 'required|integer' ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $relaId = $request->input('rela_id'); $dramaId = $request->input('drama_id'); $userId = $request->input('user_id'); $startDate = $request->input('start_date'); $endDate = $request->input('end_date'); $enable = $request->input('enable'); $sysGroupId= $request->input('sys_group_id'); list($res, $code) = PitcherService::adqEditPitcher($relaId, $dramaId, $userId, $startDate, $endDate, $enable, $sysGroupId); return self::returnValue($res, $code); } /** * 公众号绑定数据源和企微 */ public function adqBindUserActionSetId(Request $request) { $validator = \Validator::make($request->all(),[ 'account_id' => 'required|string', 'user_action_set_id' => 'required', // 'corpid' => 'required', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $accountId = $request->input('account_id'); $userActionSetId = $request->input('user_action_set_id'); $corpId = $request->input('corpid'); $sysGroupId = $request->input('sys_group_id'); $isProvisionalStat = $request->input('is_provisional_stat', 0); $res = PitcherService::adqBindUserActionSetId($accountId, $userActionSetId, $corpId, $sysGroupId, $isProvisionalStat); return self::returnValue($res); } /* * adq投放账号设置回传方式 */ public function setAdqAccountReportRule(Request $request) { $validator = \Validator::make($request->all(),[ 'account_ids' => 'required|array', 'report_type' => 'required|integer', 'enable' => 'required|in:0,1', 'if_all' => 'nullable|in:0,1', 'purchase_enable' => 'required|in:0,1', 'amount_enable' => 'required|in:0,1', 'amount_setvale' => 'array|required_if:amount_enable,1', 'reset_enable' => 'required|in:0,1', 'reset_setvale' => 'nullable|date_format:H:i|required_if:reset_enable,1', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $accountIds = $request->input('account_ids'); $reportType = $request->input('report_type'); $enable = $request->input('enable'); $ifAll = $request->input('if_all', 0); $purchaseEnable = $request->input('purchase_enable'); $missEnable = 0; $missSetvale = $request->input('miss_setvale'); $missValue = $request->input('miss_value', 1); $sysGroupId = $request->input('sys_group_id'); $amountEnable = $request->input('amount_enable'); $amountSetvale = $request->input('amount_setvale'); $resetEnable = $request->input('reset_enable'); $resetSetvale = $request->input('reset_setvale'); $adminId = $request->input('admin_id'); list($res, $code) = PitcherService::setAdqAccountReportRule($accountIds, $reportType, $enable, $purchaseEnable , $missEnable, $missSetvale, $sysGroupId, $missValue, $ifAll, $amountEnable, $amountSetvale, $resetEnable, $resetSetvale, $adminId); return self::returnValue($res, $code); } /** * 所有投放账号列表 * @return array */ public function adAccountList(Request $request) { $keyword = $request->input('keyword'); $sysGroupId = $request->input('sys_group_id'); $adminId = $request->input('admin_id'); $isSystemAdmin = $request->input('is_system_admin'); $res = PitcherService::adAccountList($keyword, $sysGroupId, $adminId, $isSystemAdmin); return self::returnValue($res); } public function adqAccountBindUserAction(Request $request) { $validator = \Validator::make($request->all(),[ 'account_id' => 'required', 'user_list' => 'array', 'confirm' => 'required|in:0,1', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $accountId = $request->input('account_id'); $userList = $request->input('user_list'); $confirm = $request->input('confirm', 0); $sysGroupId = $request->input('sys_group_id'); list($res, $code) = PitcherService::adqAccountBindUserAction($accountId, $userList, $confirm, $sysGroupId); return self::returnValue($res, $code); } public function adqAccountBindUserList(Request $request) { $validator = \Validator::make($request->all(),[ 'account_id' => 'required', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $accountId = $request->input('account_id'); $list = PitcherService::adqAccountBindUserList($accountId); return self::returnValue($list); } public function adqAccountBindUserDelete(Request $request) { $validator = \Validator::make($request->all(),[ 'data_id' => 'required', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $dataId = $request->input('data_id'); $res = PitcherService::adqAccountBindUserDelete($dataId); return self::returnValue($res); } public function adqAccountBindAppId(Request $request) { $validator = \Validator::make($request->all(),[ 'data_id_list' => 'required|array', 'app_id' => 'nullable|string', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 3001); } $dataIdList = $request->input('data_id_list'); $appId = $request->input('app_id'); $errcode = 0; PitcherService::adqAccountBindAppId($dataIdList, $appId, $errcode); return self::returnValue('', $errcode); } }