uawdijnntqw1x1x1
IP : 216.73.216.130
Hostname : it-staging-server
Kernel : Linux it-staging-server 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
forge
/
stage.herta-bht.smartcon-survey.com
/
app
/
Imports
/
InterviewImporter.php
/
/
<?php namespace App\Imports; use App\Models\Country; use App\Models\DataUpload; use App\Models\Interview; use App\Services\ExternalDataService; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use RuntimeException; class InterviewImporter { public static function import(Country $country, int $wave): void { $dataUpload = DataUpload::where('country_id', $country->id) ->where('wave', $wave) ->first(); if ($dataUpload) { throw new RuntimeException('Data already uploaded'); } $interviews = ExternalDataService::table(config('database.connections.survey_db.quota_table')) ->select(['internalid', 'scpid', 'userid', 'completed', 'istart', 'age', 'gender', 'nielsen', DB::raw('scpid as welle')]) ->filters([ 'completed' => 1, 'scpid' => $wave, ])->query()->get(); Interview::import($interviews, $country); DataUpload::create([ 'country_id' => $country->id, 'wave' => $wave, 'interviews_count' => $interviews->count(), 'quarter' => Carbon::now()->quarter, 'year' => Carbon::now()->year, ]); } }
/home/forge/stage.herta-bht.smartcon-survey.com/app/Imports/InterviewImporter.php