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