added events

This commit is contained in:
amikhaylov
2026-06-13 21:26:05 +03:00
parent 222e8984fc
commit d5f947d59e
5 changed files with 157 additions and 13 deletions
+8 -8
View File
@@ -10,19 +10,19 @@ class GigsLoader
public function getEvents(): array
{
$data = Event::select(
"Event.Name as event",
"Event.PlaceId as place_id",
"events.name as event",
"events.place_id as place_id",
"places.name as place",
"places.address as address",
"places.phone as phone",
"places.url as url",
DB::Raw("DAY(Event.Date) as mday"),
DB::Raw("MONTH(Event.Date) as month"),
DB::Raw("DATE_FORMAT(Event.Time, '%H:%s') as time"),
DB::Raw("CONCAT(DATE_FORMAT(Event.Date,'%Y-%m-%d'),
'T',DATE_FORMAT(Event.Time, '%H:%i:%s')) as fulldate")
DB::Raw("DAY(events.date) as mday"),
DB::Raw("MONTH(events.date) as month"),
DB::Raw("DATE_FORMAT(events.time, '%H:%s') as time"),
DB::Raw("CONCAT(DATE_FORMAT(events.date,'%Y-%m-%d'),
'T',DATE_FORMAT(events.time, '%H:%i:%s')) as fulldate")
)->join("places", function ($join){
$join->on("places.id", "=", "Event.PlaceId")
$join->on("places.id", "=", "events.place_id")
->where("places.deleted_at", NULL);
});
$data = $data->get();
+5 -5
View File
@@ -9,11 +9,11 @@ class Event extends Model
{
use SoftDeletes;
const DELETED_AT = 'DeleteDate';
const UPDATED_AT = 'UpdatedDate';
const CREATED_AT = 'DateOfCreation';
const DELETED_AT = 'deleted_at';
const UPDATED_AT = 'updated_at';
const CREATED_AT = 'created_at';
protected $primaryKey = 'Id';
protected $table = 'Event';
protected $fillable = ['Name', 'Date', 'Time', 'Archived'];
protected $table = 'events';
protected $fillable = [ 'name', 'date', 'time', 'archived' ];
}