Basic implementation event signup
This commit is contained in:
1 parent
a66f2d2422
commit
a69d83bc0a
321 files changed
+138376
-644
No files matched your search
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Reqeust;
|
||||
|
||||
|
||||
use Bdp\Libs\CommonModel;
|
||||
use Bdp\Modules\EventParticipants\Models\Event;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class AnwesenheitRequest {
|
||||
public static function send(CommonModel $participant) {
|
||||
$anreise = \DateTime::createFromFormat('Y-m-d', $participant->anreise);
|
||||
$abreise = \DateTime::createFromFormat('Y-m-d', $participant->abreise);
|
||||
|
||||
$cmpd = date_diff($anreise, $abreise);
|
||||
$days = $cmpd->d;
|
||||
|
||||
if ($days== 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return $days;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user