|
|
@ -335,27 +335,25 @@ class CarInfoHandle |
|
|
|
$sources = []; |
|
|
|
$sources = []; |
|
|
|
break; |
|
|
|
break; |
|
|
|
} else if ($source_a['car_phone'] == $source['car_phone']) { |
|
|
|
} else if ($source_a['car_phone'] == $source['car_phone']) { |
|
|
|
foreach (['car_no', 'engine_no', 'register_date', 'insurer1_date'] as $key) { |
|
|
|
if ($source_a['insurer1_date'] != $source['insurer1_date'] && (trim($source_a['insurer1_date']) == '' || $source_a['insurer1_date'] < $source['insurer1_date'])) { |
|
|
|
if ($source_a[$key] != $source[$key]) { |
|
|
|
|
|
|
|
if (trim($source_a[$key]) == '') { |
|
|
|
|
|
|
|
list($source_a, $source) = [$source, $source_a]; |
|
|
|
list($source_a, $source) = [$source, $source_a]; |
|
|
|
CarInfoT::destroy($source['id']); |
|
|
|
CarInfoT::destroy($source['id']); |
|
|
|
unset($sources[$index]); |
|
|
|
unset($sources[$index]); |
|
|
|
break; |
|
|
|
} else if ($source_a['insurer2_date'] != $source['insurer2_date'] && (trim($source_a['insurer2_date']) == '' || $source_a['insurer2_date'] < $source['insurer2_date'])) { |
|
|
|
} else if ($key == 'car_no' && !in_array(strlen($source_a[$key]), [7,8])) { |
|
|
|
list($source_a, $source) = [$source, $source_a]; |
|
|
|
|
|
|
|
CarInfoT::destroy($source['id']); |
|
|
|
|
|
|
|
unset($sources[$index]); |
|
|
|
|
|
|
|
} else if ($source_a['car_no'] != $source['car_no'] && (trim($source_a['car_no']) == '' || !in_array(strlen($source_a['car_no']), [7,8]))) { |
|
|
|
list($source_a, $source) = [$source, $source_a]; |
|
|
|
list($source_a, $source) = [$source, $source_a]; |
|
|
|
CarInfoT::destroy($source['id']); |
|
|
|
CarInfoT::destroy($source['id']); |
|
|
|
unset($sources[$index]); |
|
|
|
unset($sources[$index]); |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} else if (!preg_match('/^1[3-9][0-9]{9}/', $source['car_phone'])) { |
|
|
|
if (isset($source[$index])) { |
|
|
|
CarInfoT::destroy($source['id']); |
|
|
|
CarInfoT::destroy($source['id']); |
|
|
|
unset($sources[$index]); |
|
|
|
unset($sources[$index]); |
|
|
|
} else if (CarInfoT::where('car_phone', $source['car_phone'])->count() >= 6) { |
|
|
|
} |
|
|
|
|
|
|
|
} else if (!preg_match('/^1[3-9][0-9]{9}/', $source['car_phone'])) { |
|
|
|
CarInfoT::destroy($source['id']); |
|
|
|
CarInfoT::destroy($source['id']); |
|
|
|
CarInfoT::where('car_phone', $source['car_phone'])->update(['car_phone' => '']); |
|
|
|
|
|
|
|
unset($sources[$index]); |
|
|
|
unset($sources[$index]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|