added events
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Library\VK\Service\VkPostImportService;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class VkCheckStatus extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'app:vk-check-status';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Command description';
|
||||
|
||||
public function __construct(
|
||||
protected VkPostImportService $import_service
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->import_service->run();
|
||||
|
||||
|
||||
|
||||
//
|
||||
// unset($result['response'][0]['attachments']);
|
||||
// unset($result['response'][0]['copy_history'][0]['attachments']);
|
||||
// print_r($result);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -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' ];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user