Browse Source

活动行事历导入错误返回8

master
wanghongjun 1 day ago
parent
commit
ef6397f033
  1. 6
      app/Imports/EventCalendarImport.php

6
app/Imports/EventCalendarImport.php

@ -12,7 +12,7 @@ class EventCalendarImport implements ToModel
{
protected string $user_id;
protected OperationLogService $logService;
protected int $index = 1;
protected int $index = 0;
protected array $error = [];
public function __construct(string $user_id)
@ -28,10 +28,11 @@ class EventCalendarImport implements ToModel
*/
public function model(array $row)
{
if ($this->index == 1) {
if (!$this->index) {
$this->index += 1;
return;
}
$this->index += 1;
$pattern_name = $row[1] ?? '';
$start_date = $row[2] ?? '';
$start_time = $row[3] ?? '';
@ -117,7 +118,6 @@ class EventCalendarImport implements ToModel
$model = EventCalendar::query()->create($create);
$this->logService->logCreated($model, 'event_calendar.import');
$this->index += 1;
}
protected function validateDate($datetime)

Loading…
Cancel
Save