7, 'mid' => "79b9a46daa57", 'weight' => "0.00", 'is_delete' => 0, 'title' => "星优音频处理器", ]; public function __construct() { parent::__construct(); } /** * 首页 */ public function index() { return view('ocr/index'); } public function buy() { // 获取产品信息 $info = DB::table('product')->find($this->softInfo['id']); return view('ocr/buy', ['info' => $info]); } public function help() { $size = 15; $page = Request::input('page', 1); $cid = Request::input('cid'); // 获取资讯分类 $category = DB::table('news_category')->where('product_id', $this->softInfo['id'])->get(); // 获取资讯列表 $find = DB::table('news')->where('product_id', $this->softInfo['id']) ->offset($size * ($page - 1)) ->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('ocr/help', ['category' => $category, 'list' => $list]); } public function about() { return view('ocr/about'); } public function newsDetail($mid) { // 获取资讯分类 $category = DB::table('news_category')->where('product_id', $this->softInfo['id'])->get(); $info = DB::table('news')->where('mid', $mid)->first(); return view('ocr/news_detail', ['info' => $info, 'category' => $category]); } }