getStatus(); $status = $status["status"]; $has_certificate = $member->hasCertificate(); $certificate = 0; $certificate_date = null; if($has_certificate["date"] != '') { if($has_certificate["date"] < date("Y-m-d")) $certificate = 0; if($has_certificate["date"] >= date("Y-m-d") && $has_certificate["date"] < date("Y-m-d", strtotime("+1 month"))) $certificate = 1; if($has_certificate["date"] >= date("Y-m-d", strtotime("+1 month"))) $certificate = 2; $certificate_date = $has_certificate["date"] != '' ? $has_certificate["date"] : null; } $member->current_status = $status; $member->certificate = $certificate; $member->certificate_date = $certificate_date; $member->save(); } return Command::SUCCESS; } }