Skip to content

Commit b7a17c8

Browse files
fixed bugs
1 parent 1f6e94f commit b7a17c8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/models/User.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,10 +490,6 @@ public function getRoleSlaves($roles1, $roles2, $subject_id = null)
490490
return [];
491491
}
492492

493-
if (empty($subjects)) {
494-
return [];
495-
}
496-
497493
if ($subject_id) {
498494
$subject_id = !is_array($subject_id) ? [$subject_id] : $subject_id;
499495
$subjects = array_intersect($subject_id, $subjects);
@@ -545,12 +541,18 @@ public function getId()
545541
return $this->id;
546542
}
547543

544+
/**
545+
* Checks if today is the user's birthday.
546+
*
547+
* @return bool Returns true if today is the birthday, otherwise false.
548+
*/
548549
public function isBirthdayToday()
549550
{
550551
if (empty($this->birthday)) {
551552
return false;
552553
}
553554

555+
// Compare the day and month of the birthday with today's date
554556
return date('d.m', strtotime($this->birthday)) == date('d.m');
555557
}
556558

0 commit comments

Comments
 (0)