本文整理汇总了PHP中Employee::Count方法的典型用法代码示例。如果您正苦于以下问题:PHP Employee::Count方法的具体用法?PHP Employee::Count怎么用?PHP Employee::Count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Employee
的用法示例。
在下文中一共展示了Employee::Count方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDashboardItemData
public function getDashboardItemData()
{
$data = array();
$emp = new Employee();
$data['numberOfEmployees'] = $emp->Count("1 = 1");
return $data;
}
示例2: getInitData
public function getInitData($req)
{
$data = array();
$employees = new Employee();
$data['numberOfEmployees'] = $employees->Count("1 = 1");
$company = new CompanyStructure();
$data['numberOfCompanyStuctures'] = $company->Count("1 = 1");
$user = new User();
$data['numberOfUsers'] = $user->Count("1 = 1");
$project = new Project();
$data['numberOfProjects'] = $project->Count("status = 'Active'");
$attendance = new Attendance();
$data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '" . date("Y-m-d H:i:s", strtotime("-1 week")) . "'");
if (empty($data['numberOfAttendanceLastWeek'])) {
$data['numberOfAttendanceLastWeek'] = 0;
}
$empLeave = new EmployeeLeave();
$data['numberOfLeaves'] = $empLeave->Count("date_start > '" . date("Y-m-d") . "'");
$timeEntry = new EmployeeTimeEntry();
$data['numberOfAttendanceLastWeek'] = $timeEntry->Count("in_time > '" . date("Y-m-d H:i:s", strtotime("-1 week")) . "'");
$candidate = new Candidate();
$data['numberOfCandidates'] = $candidate->Count("1 = 1");
$job = new Job();
$data['numberOfJobs'] = $job->Count("status = 'Active'");
$course = new Course();
$data['numberOfCourses'] = $course->Count("1 = 1");
return new IceResponse(IceResponse::SUCCESS, $data);
}
示例3: deleteProfileImage
public function deleteProfileImage($req)
{
$profileId = $this->getCurrentProfileId();
$subordinate = new Employee();
$subordinatesCount = $subordinate->Count("supervisor = ? and id = ?", array($profileId, $req->id));
if ($this->user->user_level == 'Admin' || $this->user->employee == $req->id || $subordinatesCount == 1) {
$fs = FileService::getInstance();
$res = $fs->deleteProfileImage($req->id);
return new IceResponse(IceResponse::SUCCESS, $res);
}
return new IceResponse(IceResponse::ERROR, "Not allowed to delete profile image");
}
示例4: getInitData
public function getInitData($req)
{
$data = array();
$emp = new Employee();
$data['numberOfEmployees'] = $emp->Count("status = 'Active' and supervisor = ?", array($this->getCurrentProfileId()));
$data['lastTimeSheetHours'] = $this->getLastTimeSheetHours($req)->getData();
$data['activeProjects'] = $this->getEmployeeActiveProjects($req)->getData();
$data['pendingLeaves'] = $this->getPendingLeaves($req)->getData();
$candidate = new Candidate();
$data['numberOfCandidates'] = $candidate->Count("1 = 1");
$job = new Job();
$data['numberOfJobs'] = $job->Count("status = 'Active'");
$attendance = new Attendance();
$data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '" . date("Y-m-d H:i:s", strtotime("-1 week")) . "'");
$course = new Course();
$data['numberOfCourses'] = $course->Count("1 = 1");
return new IceResponse(IceResponse::SUCCESS, $data);
}