本文整理匯總了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);
}