productInfo = $this->getProductInfo('fNNKUH0jsIDJ'); View::share('productInfo', $this->productInfo); // 获取当前的Windows下载版本 product_version $this->windowsVersionInfo = $this->getProductVersion($this->productInfo->id); View::share('windowsVersionInfo', $this->windowsVersionInfo); } /** * 首页 */ public function index() { return view('compress/index'); } public function help($cid = '') { $size = 15; $page = Request::input('page', 1); // 获取资讯分类列表 $category = DB::table('news_category')->where('product_id', $this->productInfo->id)->orderBy('id', 'asc')->get(); if (empty($cid) && $category) { $cid = $category[0]->mid; } // 获取资讯列表 $find = DB::table('news')->where('product_id', $this->productInfo->id) ->offset($size * ($page - 1)) ->orderBy('id', 'desc') ->limit($size); if ($cid) { $info = DB::table('news_category')->select('id')->where('mid', $cid)->first(); if ($info) { $find->where('category_id', $info->id); } } $list = $find->get(); return view('compress/help', ['cid' => $cid, 'category' => $category, 'list' => $list]); } /** * 资讯详情 */ public function newsDetail($mid) { // 获取资讯列表 $info = DB::table('news')->where('mid', $mid)->where('is_delete', 0)->first(); // 热门点击 $hotList = DB::table('news')->where('product_id', $this->productInfo->id)->where('category_id', $info->category_id) ->offset(mt_rand(7, 10)) ->orderBy('id', 'desc') ->limit(6) ->get(); // 最近更新 $recentList = DB::table('news')->where('product_id', $this->productInfo->id)->where('category_id', $info->category_id) ->orderBy('id', 'desc') ->limit(6) ->get(); return view('compress/news_detail', ['info' => $info, 'hotList' => $hotList, 'recentList' => $recentList]); } public function about() { return view('compress/about'); } }