本文整理匯總了PHP中app\Employee::count方法的典型用法代碼示例。如果您正苦於以下問題:PHP Employee::count方法的具體用法?PHP Employee::count怎麽用?PHP Employee::count使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\Employee
的用法示例。
在下文中一共展示了Employee::count方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct()
{
$count = Employee::count();
$countProj = Project::count();
$data = Employee::all();
$YourRole = "";
if (count(Auth::user()) > 0) {
$YourRole = Auth::user()->UserRoles->role;
}
$Role2 = $this->Role1;
// Count Unconfirmed
$cc = 0;
foreach ($data as $da) {
if ($da->confirm == 0) {
$cc++;
}
}
$countConf = $cc;
// Count Confirmed
$cc1 = 0;
foreach ($data as $dat) {
if ($dat->confirm == 1) {
$cc1++;
}
}
$countConfirmed = $cc1;
View::share('countConf', $countConf);
View::share('YourRole', $YourRole);
View::share('countConfirmed', $countConfirmed);
View::share('count', $count);
View::share('countProj', $countProj);
}
示例2: home
public function home()
{
$stats['employees'] = \App\Employee::count();
$stats['assets'] = \App\Asset::count();
$stats['users'] = \App\User::count();
$stats['vendors'] = \App\Vendor::count();
return View('pages.dashboard', compact('stats'));
}
示例3: __construct
public function __construct()
{
$count = Employee::count();
$countProj = Project::count();
$data = Employee::all();
$DataEm = "";
$YourRole = "";
$undisplayRoleAcc = "";
if (count(Auth::user()) > 0) {
$YourRole = Auth::user()->UserRoles->role;
if (Auth::user()->id_employees > 0) {
$DataEm = Employee::where('id', Auth::user()->id_employees)->get();
}
}
if ($YourRole == 11) {
$undisplayRoleAcc = "undisplayRole";
}
$Role2 = $this->Role1;
// Count Unconfirmed
$cc = 0;
foreach ($data as $da) {
if ($da->confirm == 0) {
$cc++;
}
}
$countConf = $cc;
// Count Confirmed
$cc1 = 0;
foreach ($data as $dat) {
if ($dat->confirm == 1) {
$cc1++;
}
}
$countConfirmed = $cc1;
View::share('countConf', $countConf);
View::share('DataEm', $DataEm);
View::share('undisplayRoleAcc', $undisplayRoleAcc);
View::share('YourRole', $YourRole);
View::share('countConfirmed', $countConfirmed);
View::share('count', $count);
View::share('countProj', $countProj);
}
示例4: totalEmployee
public function totalEmployee()
{
$result = Employee::count();
return $result;
}
示例5: index
public function index()
{
$dataView = ['productsCount' => Product::count(), 'plansCount' => Plan::where('month', \Config::get('app.current_month'))->count(), 'reportsCount' => Report::where('month', \Config::get('app.current_month'))->count(), 'customersCount' => Customer::count(), 'employeesCount' => Employee::count()];
return view('admin.index', $dataView);
}