|
|
|
@ -24,7 +24,7 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
|
|
|
|
|
protected $fillable = [ |
|
|
|
|
'name', 'email', 'role_id', 'username', 'session_login', 'phone_number', 'email', 'address', |
|
|
|
|
'fcm_token', 'gender', 'birth_place', 'birth_date', 'blood_type', 'ktp_number', 'working_hours', |
|
|
|
|
'created_at', 'created_by', 'updated_at', 'updated_by', 'status_resource' |
|
|
|
|
'created_at', 'created_by', 'updated_at', 'updated_by', 'status_resource', 'discount_id' |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
const CREATED_AT = 'created_at'; |
|
|
|
@ -83,11 +83,9 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
|
|
|
|
|
->first(); |
|
|
|
|
|
|
|
|
|
$shift = null; |
|
|
|
|
if ($userShift !== null) |
|
|
|
|
{ |
|
|
|
|
if ($userShift !== null) { |
|
|
|
|
$shiftId = null; |
|
|
|
|
switch ($ts->shortEnglishDayOfWeek) |
|
|
|
|
{ |
|
|
|
|
switch ($ts->shortEnglishDayOfWeek) { |
|
|
|
|
case "Mon": |
|
|
|
|
$shiftId = $userShift->mon_shift_id; |
|
|
|
|
break; |
|
|
|
@ -123,8 +121,7 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($shift !== null) |
|
|
|
|
{ |
|
|
|
|
if ($shift !== null) { |
|
|
|
|
$from = Carbon::createFromTimeString($shift->start_time, $tz) |
|
|
|
|
->subMinutes($shift->flex_time_minute); |
|
|
|
|
$to = Carbon::createFromTimeString($shift->end_time, $tz) |
|
|
|
@ -150,16 +147,14 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
$ts = $at; |
|
|
|
|
if ($at !== null) |
|
|
|
|
{ |
|
|
|
|
if ($at !== null) { |
|
|
|
|
$ts = Carbon::now($tz); |
|
|
|
|
} |
|
|
|
|
$tsSec = $ts->secondsSinceMidnight(); |
|
|
|
|
|
|
|
|
|
$status = ""; |
|
|
|
|
$wt = $this->getWorkingTime($ts, $tz); |
|
|
|
|
if ($wt === null) |
|
|
|
|
{ |
|
|
|
|
if ($wt === null) { |
|
|
|
|
$status = self::HOLIDAY; |
|
|
|
|
} else { |
|
|
|
|
$from = $wt->from; |
|
|
|
|