public function index() { //总访问量 $visits = \Cache::get('visits', 0); //今日注册用户 $todayUsers = User::today()->count('user_id'); //总用户数 $totalUsers = User::count('user_id'); //管理员聊天记录 $chatMessages = AdminMessage::with('admin')->limit(10)->oldest()->get(); //最新留言 $guestBook = GuestBook::with('user')->limit(10)->oldest()->get(); //最新注册用户 $users = User::limit(24)->oldest()->get(); //最新评论 $comments = Comment::limit(10)->oldest()->get(); // 总会员数量/待审核会员/普通会员/高端会员 $user_all_num = User::count('user_id'); $user_shenhe_num = User::status(\App\Enum\User::STATUS_CHECK)->count('user_id'); $user_level1_num = User::level(\App\Enum\User::LEVEL_1)->count('user_id'); $user_level3_num = User::level(\App\Enum\User::LEVEL_3)->count('user_id'); // 自我介绍待审核数量 $user_info_num = UserInfo::where('introduce_status', \App\Enum\User::INTRODUCE_CHECK)->count('user_id'); // 会员相片审核数量 $user_gallery_num = DB::table('user_gallery')->where('status', '待审核')->where('image_url', '!=', '')->count('photo_id'); // 文章数量 $article_num = DB::table('articles')->count('article_id'); $res = array('user_all_num' => $user_all_num, 'user_shenhe_num' => $user_shenhe_num, 'user_level1_num' => $user_level1_num, 'user_level3_num' => $user_level3_num, 'user_info_num' => $user_info_num, 'user_gallery_num' => $user_gallery_num, 'article_num' => $article_num); return $this->view('index', $res); // return $this->view('index')->with('visits', $visits)->with('todayUsers', $todayUsers)->with('totalUsers', // $totalUsers)->with('chatMessages', $chatMessages)->with('guestBook', $guestBook)->with('users', // $users)->with('comments', $comments); }
public function getRegister() { $user = User::status(UserEnum::STATUS_NOCHECK)->get(); return $this->view('check')->with('users', $user); }