find(30); // Auth::loginUsingId() Auth::guard('wechat')->loginUsingId(1); //课程中心 $kcinfo = Article::wherein('articletype_id', [9])->where('ispush', 1)->orderby('created_at')->select('name', 'created_at', 'id', 'picture')->take(4)->get(); //stream $stream = Article::wherein('articletype_id', [8])->where('ispush', 1)->orderby('created_at')->select('name', 'created_at', 'id', 'picture')->take(4)->get(); //资讯动态 // $zxdt = Article::wherein('articletype_id', [8, 9, 10])->where('ispush', 1)->orderby('created_at')->select('name', 'created_at', 'id', 'picture')->take(4)->get(); // //科研信息 // $keyaninfo = Article::where('articletype_id', 3)->where('ispush', 1)->orderby('created_at')->select('name', 'created_at', 'id', 'picture')->take(4)->get(); $lunbo = Lunbo::where('isshow', 1)->select('img')->get(); $tools = Tool::where('status', 1)->orderBy('order', 'desc')->limit(6)->get(); return view('xt.index', compact('kcinfo', 'stream', 'lunbo', 'tools')); } public function articleList($articleid) { $info = Article::where('articletype_id', $articleid)->where('ispush', 1)->orderby('created_at')->select('name', 'created_at', 'articletype_id', 'id', 'picture')->paginate(8); $temp = Articletype::where('id', $articleid)->first(); $title = $temp['name']; $pid = \request()->get('pid', $articleid); $lists = Articletype::where('id', $pid)->get(); return view('xt.list', compact('info', 'title', 'temp', 'lists')); } public function register() { return view('xt.index'); } public function person() { Auth::guard('wechat')->loginUsingId(1); $userinfo = Auth::guard('wechat')->user(); return view('xt.person', compact('userinfo')); } public function info(Request $request) { $uu = User::where('id', Auth::guard('wechat')->user()->id)->first(); if ($uu->school_id) { return "如需更改请联系管理员"; } $uu->school_id = $request->school; $uu->class_id = $request->class; $uu->grade_id = $request->grade; $val = $uu->save(); if ($val) { return "信息已更新"; } return "信息更新失败"; } public function userexit() { session . pop('user'); session . pop('userinfo'); } }