Ejemplo n.º 1
0
 private function empTlog($employeeid, $date, $i, $order)
 {
     return Timelog::employeeid($employeeid)->whereBetween('datetime', [$date->format('Y-m-d') . ' 06:00:00', $date->copy()->addDay()->format('Y-m-d') . ' 05:59:00'])->txncode($i)->orderBy('datetime', $order)->first();
 }
Ejemplo n.º 2
0
 /**
  * Get all the timelog for an employee on the day.
  *
  * @param  Employee $employee, Carbon $date ('Y-m-d')
  * @return Collection of timelog
  */
 public function employeeTimelogs(Employee $employee, $date)
 {
     $res = Timelog::employeeid($employee->id)->whereBetween('datetime', [$date->copy()->format('Y-m-d') . ' 06:00:00', $date->copy()->addDay()->format('Y-m-d') . ' 05:59:59'])->orderBy('datetime', 'ASC')->orderBy('txncode', 'ASC')->get();
     return count($res) > 0 ? $res : false;
 }