Browse Source

add discount_id

pull/1/head
farhantock 7 months ago
parent
commit
53b37f87ea
  1. 3
      app/Models/Company.php
  2. 17
      app/Models/User.php

3
app/Models/Company.php

@ -34,6 +34,7 @@ class Company extends Model
'updated_by',
'cluster',
'type_account',
'date_register'
'date_register',
'discount_id'
];
}

17
app/Models/User.php

@ -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;

Loading…
Cancel
Save