重复车架处理增加初登日期比对

master
zhaocheng 2 years ago
parent 8d944ae308
commit 21600afe6b
  1. 9
      extend/service/CarInfoHandle.php

@ -329,12 +329,12 @@ class CarInfoHandle
$sources = []; $sources = [];
break; break;
} else if ($source_a['car_phone'] == $source['car_phone']) { } else if ($source_a['car_phone'] == $source['car_phone']) {
if ($source_a['insurer1_date'] != $source['insurer1_date'] && (trim($source_a['insurer1_date']) == '' || $source_a['insurer1_date'] < $source['insurer1_date'])) { if (trim($source_a['insurer1_date']) != trim($source['insurer1_date']) && (trim($source_a['insurer1_date']) == '' || $source_a['insurer1_date'] < $source['insurer1_date'])) {
list($source_a, $source) = [$source, $source_a]; list($source_a, $source) = [$source, $source_a];
$this->repeatDataHandle($source, $id, 'frame'); $this->repeatDataHandle($source, $id, 'frame');
$delete_num ++; $delete_num ++;
unset($sources[$index]); unset($sources[$index]);
} else if ($source_a['insurer2_date'] != $source['insurer2_date'] && (trim($source_a['insurer2_date']) == '' || $source_a['insurer2_date'] < $source['insurer2_date'])) { } else if (trim($source_a['insurer2_date']) != trim($source['insurer2_date']) && (trim($source_a['insurer2_date']) == '' || $source_a['insurer2_date'] < $source['insurer2_date'])) {
list($source_a, $source) = [$source, $source_a]; list($source_a, $source) = [$source, $source_a];
$this->repeatDataHandle($source, $id, 'frame'); $this->repeatDataHandle($source, $id, 'frame');
$delete_num ++; $delete_num ++;
@ -344,6 +344,11 @@ class CarInfoHandle
$this->repeatDataHandle($source, $id, 'frame'); $this->repeatDataHandle($source, $id, 'frame');
$delete_num ++; $delete_num ++;
unset($sources[$index]); unset($sources[$index]);
} else if ($source_a['register_date'] != $source['register_date'] && (trim($source_a['register_date']) == '' || $source_a['register_date'] < $source['register_date'])) {
list($source_a, $source) = [$source, $source_a];
$this->repeatDataHandle($source, $id, 'frame');
$delete_num ++;
unset($sources[$index]);
} }
if (isset($sources[$index])) { if (isset($sources[$index])) {
$this->repeatDataHandle($source, $id, 'frame'); $this->repeatDataHandle($source, $id, 'frame');

Loading…
Cancel
Save