|
|
|
@ -5,6 +5,7 @@ namespace App\Imports; |
|
|
|
use App\Models\EventCalendar; |
|
|
|
use App\Models\ParkingPattern; |
|
|
|
use App\Services\AdminTranslationService; |
|
|
|
use App\Services\EventCalendarService; |
|
|
|
use App\Services\OperationLogService; |
|
|
|
use Maatwebsite\Excel\Concerns\ToModel; |
|
|
|
|
|
|
|
@ -14,12 +15,14 @@ class EventCalendarImport implements ToModel |
|
|
|
protected OperationLogService $logService; |
|
|
|
protected int $index = 0; |
|
|
|
protected array $error = []; |
|
|
|
protected EventCalendarService $service; |
|
|
|
|
|
|
|
public function __construct(string $user_id) |
|
|
|
{ |
|
|
|
$this->user_id = $user_id; |
|
|
|
$this->logService = new OperationLogService(); |
|
|
|
$this->logService->menuTitle = 'event_calendar'; |
|
|
|
$this->service = new EventCalendarService($this->logService); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -121,6 +124,14 @@ class EventCalendarImport implements ToModel |
|
|
|
$model = EventCalendar::query()->create($create); |
|
|
|
|
|
|
|
$this->logService->logCreated($model, 'event_calendar.import'); |
|
|
|
|
|
|
|
$newValue = $model->toArray(); |
|
|
|
$this->service->nowChangeMode( |
|
|
|
$save_start_time, |
|
|
|
$save_end_time, |
|
|
|
$newValue['id'], |
|
|
|
$this->user_id |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
protected function validateDate($datetime) |
|
|
|
|