本文整理汇总了PHP中App\Model\User::status方法的典型用法代码示例。如果您正苦于以下问题:PHP User::status方法的具体用法?PHP User::status怎么用?PHP User::status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类App\Model\User
的用法示例。
在下文中一共展示了User::status方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
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);
}
示例2: getRegister
public function getRegister()
{
$user = User::status(UserEnum::STATUS_NOCHECK)->get();
return $this->view('check')->with('users', $user);
}