|
|
@@ -49,7 +49,7 @@ class LaborReport extends Model
|
|
|
public function getRoundCheckInAtAttribute(){
|
|
|
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>=0&&$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) 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');
|
|
|
}
|
|
|
@@ -58,7 +58,7 @@ class LaborReport extends Model
|
|
|
$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');
|
|
|
+ if ($round_check_out_at>30&&$round_check_out_at<=59) return Carbon::parse($this['check_out_at'])->clone()->setMinutes(30)->setSeconds(00)->format('Y-m-d H:i:s');
|
|
|
}
|
|
|
public function getRemarkAttribute(){
|
|
|
return $this->hasOne('App\Sign','signable_id','id')
|