added member-state seeds without checking for birthdates
This commit is contained in:
+4
-5
@@ -22,7 +22,6 @@ class Person extends Model
|
||||
public function isMember()
|
||||
{
|
||||
$latest = $this->memberStates->last();
|
||||
|
||||
if (is_null($latest)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -56,7 +55,7 @@ class Person extends Model
|
||||
|
||||
/*
|
||||
* Return the last date since when the person is an active member.
|
||||
*
|
||||
*
|
||||
* @return Carbon\Carbon
|
||||
*/
|
||||
public function activeSince()
|
||||
@@ -64,7 +63,7 @@ class Person extends Model
|
||||
$latest = $this->memberStates
|
||||
->orderBy('joining_date', 'desc')
|
||||
->first();
|
||||
|
||||
|
||||
return Carbon::parse($latest['joining_date']);
|
||||
}
|
||||
|
||||
@@ -76,7 +75,7 @@ class Person extends Model
|
||||
public function activeTime()
|
||||
{
|
||||
$activeTimes = $this->memberStates;
|
||||
|
||||
|
||||
$diff = 0;
|
||||
|
||||
foreach ($activeTimes as $period) {
|
||||
@@ -84,7 +83,7 @@ class Person extends Model
|
||||
$end = is_null($period['leaving_date']) ?
|
||||
Carbon::now() :
|
||||
Carbon::parse($period['leaving_date']);
|
||||
|
||||
|
||||
$diffYears = Carbon::parse($start)->diffInYears($end);
|
||||
$diffDays = Carbon::parse($start)->diffInDays($end);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user