|
|
@@ -50,12 +50,14 @@ class LaborReport extends Model
|
|
|
if (!$this['check_in_at'])return null;
|
|
|
$round_check_in_at=Carbon::parse($this['check_in_at'])->format('i');
|
|
|
if ($round_check_in_at>=0&&$round_check_in_at<30) return Carbon::parse($this['check_in_at'])->clone()->setMinutes(00)->setSeconds(00)->format('Y-m-d H:i:s');
|
|
|
+ if ($round_check_in_at==30) return Carbon::parse($this['check_in_at'])->clone()->setMinutes(30)->setSeconds(00)->format('Y-m-d H:i:s');
|
|
|
if ($round_check_in_at>30&&$round_check_in_at<=59) return Carbon::parse($this['check_in_at'])->clone()->addHour()->setMinutes(00)->setSeconds(00)->format('Y-m-d H:i:s');
|
|
|
}
|
|
|
public function getRoundCheckOutAtAttribute(){
|
|
|
if (!$this['check_out_at'])return null;
|
|
|
$round_check_out_at=Carbon::parse($this['check_out_at'])->format('i');
|
|
|
if ($round_check_out_at>=0&&$round_check_out_at<30) return Carbon::parse($this['check_out_at'])->clone()->setMinutes(00)->setSeconds(00)->format('Y-m-d H:i:s');
|
|
|
+ if ($round_check_out_at==30) return Carbon::parse($this['check_out_at'])->clone()->setMinutes(30)->setSeconds(00)->format('Y-m-d H:i:s');
|
|
|
if ($round_check_out_at>30&&$round_check_out_at<=59) return Carbon::parse($this['check_out_at'])->clone()->addHour()->setMinutes(00)->setSeconds(00)->format('Y-m-d H:i:s');
|
|
|
}
|
|
|
public function getRemarkAttribute(){
|