all(),[ 'platform_id' => 'required|integer', 'account' => 'required|string', 'status' => ['required', Rule::in([1, 2])],//1 启用 2禁用 ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $params['platform_id'] = $request->input('platform_id'); $params['account'] = $request->input('account'); $params['description'] = $request->input('description'); $params['status'] = $request->input('status'); $params['sys_group_id'] = $request->input('sys_group_id'); list($res, $code) = IntelligentMassSendingService::addAccount($params); return self::returnValue($res, $code); } # 账号列表 public function accountIndex(Request $request) { $validator = \Validator::make($request->all(),[ 'page' => 'required|numeric', 'page_size' => 'required|numeric', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $page = $request->input('page', 1); $pageSize = $request->input('page_size', 20); $sysGroupId = $request->input('sys_group_id'); list($list, $count) = IntelligentMassSendingService::accountIndex($page, $pageSize, $sysGroupId); return self::returnPageValue($list, $count, $pageSize, $page); } # 编辑账号 public function editAccount(Request $request) { $validator = \Validator::make($request->all(),[ 'account_id' => 'required|integer', 'account' => 'required|string', 'platform_id' => 'required|integer', 'status' => ['required', Rule::in([1, 2])],//1 启用 2禁用 ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $accountId = $request->input('account_id'); $params['account'] = $request->input('account'); $params['platform_id'] = $request->input('platform_id'); $params['description'] = $request->input('description'); $params['status'] = $request->input('status'); list($res, $code) = IntelligentMassSendingService::editAccount($accountId, $params); return self::returnValue($res, $code); } # 账号列表--下拉框 public function accountList(Request $request) { $validator = \Validator::make($request->all(),[ 'platform_id' => 'nullable|integer', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $platformId = $request->input('platform_id'); $sysGroupId = $request->input('sys_group_id'); $list = IntelligentMassSendingService::accountList($platformId, $sysGroupId); return self::returnValue($list); } # 添加小程序 public function addSmallApp(Request $request) { $validator = \Validator::make($request->all(),[ 'app_name' => 'required|string', 'app_id' => 'required|string', 'platform_id' => 'required|integer', 'status' => ['required', Rule::in([1, 2])],//1 启用 2禁用 ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $params['app_name'] = $request->input('app_name'); $params['app_id'] = $request->input('app_id'); $params['platform_id'] = $request->input('platform_id'); $params['sys_group_id'] = $request->input('sys_group_id'); $params['status'] = $request->input('status'); list($res, $code) = IntelligentMassSendingService::addSmallApp($params); return self::returnValue($res, $code); } # 编辑小程序 public function editSmallApp(Request $request) { $validator = \Validator::make($request->all(),[ 'data_id' => 'required|integer', 'app_name' => 'required|string', 'app_id' => 'required|string', 'platform_id' => 'required|integer', 'status' => ['required', Rule::in([1, 2])],//1 启用 2禁用 ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $dataId = $request->input('data_id'); $params['app_name'] = $request->input('app_name'); $params['app_id'] = $request->input('app_id'); $params['platform_id'] = $request->input('platform_id'); $params['sys_group_id'] = $request->input('sys_group_id'); $params['status'] = $request->input('status'); list($res, $code) = IntelligentMassSendingService::editSmallApp($dataId, $params); return self::returnValue($res, $code); } # 小程序列表 public function smallAppIndex(Request $request) { $validator = \Validator::make($request->all(),[ 'page' => 'required|numeric', 'app_name' => 'nullable|string', 'page_size' => 'required|numeric', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $appName = $request->input('app_name'); $page = $request->input('page'); $pageSize = $request->input('page_size'); $sysGroupId = $request->input('sys_group_id'); list($list, $count) = IntelligentMassSendingService::smallAppIndex($appName, $page, $pageSize, $sysGroupId); return self::returnPageValue($list, $count, $pageSize, $page); } # 小程序下拉列表 public function smallAppList(Request $request) { $validator = \Validator::make($request->all(),[ 'platform_id' => 'integer', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $sysGroupId = $request->input('sys_group_id'); $platformId = $request->input('platform_id'); $list = IntelligentMassSendingService::smallAppList($sysGroupId, $platformId); return self::returnValue($list); } # 公众号下拉列表 public function appList(Request $request) { $validator = \Validator::make($request->all(),[ 'corpid' => 'required|string', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $corpid = $request->input('corpid'); $list = IntelligentMassSendingService::appList($corpid); return self::returnValue($list); } }