bugfix nikarayan
This commit is contained in:
@@ -79,7 +79,7 @@ class RoadObservationProblems extends Command
|
||||
$cities = [];
|
||||
foreach ($xml as $value) {
|
||||
// if ($value->fk_FeatureType >= 1 && $value->fk_FeatureType <= 6) { //// code ghabli
|
||||
if (RoadObserved::where('fk_RegisteredEventMessage', $value->fk_RegisteredEventMessage)->exists()) {
|
||||
if (RoadObserved::query()->where('fk_RegisteredEventMessage', '=', $value->fk_RegisteredEventMessage)->exists()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ class RoadObservationProblems extends Command
|
||||
'city_id' => $cityModel->id,
|
||||
// 'handler_type' => EdarateShahri::class,
|
||||
'edarate_shahri_id' => $cityModel->edarateShahri()->first()->id,
|
||||
'province_fa' => (isset($city['province_id']) ? Province::find($city['province_id'])->name_fa : null),
|
||||
'province_fa' => $cityModel->province()->first()->name_fa,
|
||||
'city_fa' => $cityModel ? $cityModel->name_fa : null,
|
||||
]
|
||||
);
|
||||
@@ -142,8 +142,8 @@ class RoadObservationProblems extends Command
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->info('the received body is empty');
|
||||
Log::channel('nikarayan')->error("the received body is empty" . date('Y-m-d H:i:s'));
|
||||
$this->info($result);
|
||||
Log::channel('nikarayan')->error("the received body is empty" . date('Y-m-d H:i:s') . '\t'. $result);
|
||||
return $result;
|
||||
}
|
||||
echo 'done at: ' . date("Y-m-d H:i:s") . "\n";
|
||||
|
||||
Reference in New Issue
Block a user