Verbesserungen i80n, Bugfixes, uvm
This commit is contained in:
@@ -14,9 +14,9 @@ use Nette\Utils\Random;
|
||||
class PreApplicationController extends Controller
|
||||
{
|
||||
public function send(Request $request){
|
||||
$event = $request->input('event');
|
||||
$event = $request->input('district_region');
|
||||
|
||||
$ce = ChaosEvents::where('id', $event)->where('to_date', '>=', now())->first();
|
||||
$ce = ChaosEvents::where('id', $event)->where('to_date_internal', '>=', today())->where('from_date_internal', '<=', today())->first();
|
||||
if($ce){
|
||||
|
||||
$passport_type = $request->input('passport_type');
|
||||
|
||||
@@ -8,11 +8,22 @@ class ChaosEvents extends Model
|
||||
{
|
||||
protected $table = 'chaos_events';
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'from_date_internal' => 'date',
|
||||
'to_date_internal' => 'date',
|
||||
'from_date_visible' => 'date',
|
||||
'to_date_visible' => 'date',
|
||||
];
|
||||
}
|
||||
|
||||
public function preApplications() {
|
||||
return $this->hasMany('App\Models\PreApplications', 'event_id');
|
||||
}
|
||||
|
||||
public static function getActiveEvents(){
|
||||
return self::where('to_date', '>=', now())->where('from_date', '<=', now())->get();
|
||||
return self::where('to_date_internal', '>=', today())
|
||||
->where('from_date_internal', '<=', today())->get();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user