helpCategoryService = $helpCategoryService; $this->helpService = $helpService; $this->adService = $adService; $this->ad_infos = $this->getAdInfo(); } public function index() { //获取帮助中心分类信息 $categories = $this->helpCategoryService->getCategories(array('parent_id'=>'0'), 15); $return_data = array( 'categories' => $categories, 'ads' => $this->ad_infos ); return view('app.content.help.index', $return_data); } public function list($id) { $return_data = array(); $helps = $this->helpService->getHelpsByType($id, '20'); $categories = $this->helpCategoryService->noHelpCategories(array('parent_id'=>'0'), 15); $cate_info = $this->helpCategoryService->getOneCategory(array('id'=>$id)); $this->putSeoData('help_cate', $cate_info); $return_data = array( 'categories' => $categories, 'helps' => $helps, 'cate_info' => $cate_info, 'ads' => $this->ad_infos ); return view('app.content.help.list', $return_data); } public function search(Request $request, $filter = '') { $return_data = array(); $key = $filter; if ($request->input('key')) { $key = $request->input('key'); } $where[] = array('title','like','%'.$key.'%'); $helps = $this->helpService->getHelps($where, '20'); $categories = $this->helpCategoryService->noHelpCategories(array('parent_id'=>'0'), 15); $return_data = array( 'categories' => $categories, 'helps' => $helps, 'key' => $key, 'ads' => $this->ad_infos ); return view('app.content.help.list', $return_data); } public function show($id) { $return_data = array(); $categories = $this->helpCategoryService->noHelpCategories(array('parent_id'=>'0'), 15); $help_info = $this->helpService->getHelp(array('id'=>$id)); $this->putSeoData('help', $help_info->toArray()); $return_data = array( 'categories' => $categories, 'help_info' => $help_info, 'ads' => $this->ad_infos ); return view('app.content.help.show', $return_data); } public function getAdInfo() { //$subsite_id = 0; $ad_data = array( 'theme' => 'default', 'org' => 'Home', 'alias' => 'AIX_help_top', 'num' => '1', //'subsite_id' => $subsite_id ); $ad_infos = $this->adService->getAds($ad_data); return $ad_infos; } public function testEmail() { $this->orderService->testEmail(); } }