123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- namespace App\Http\Home\Ocr;
- use App\Http\Home\HttpBaseController;
- use Illuminate\Support\Facades\DB;
- use Illuminate\Support\Facades\Request;
- class IndexController extends HttpBaseController
- {
- private $softInfo = [
- 'id' => 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]);
- }
- }
|