车架去重电话号处理调试

master
zcstatham 2 years ago
parent a5b9279a05
commit bdd53f2ffa
  1. 6
      extend/service/CarInfoHandle.php

@ -373,9 +373,11 @@ class CarInfoHandle
if (count($phones) <= 6) { if (count($phones) <= 6) {
array_shift($phones); array_shift($phones);
foreach (['id_phone', 'insured_phone', 'link_phone_1', 'link_phone_2', 'link_phone_3'] as $key) { foreach (['id_phone', 'insured_phone', 'link_phone_1', 'link_phone_2', 'link_phone_3'] as $key) {
if (!in_array($source_a[$key], $phones)) if (in_array($source_a[$key], $phones))
array_shift($phones);
else
$source_a[$key] = array_shift($phones); $source_a[$key] = array_shift($phones);
if (empty($source_a[$key])) if (empty($source_a[$key]) || empty($phones))
break; break;
} }
CarInfoT::where('id', $source_a['id'])->update($source_a); CarInfoT::where('id', $source_a['id'])->update($source_a);

Loading…
Cancel
Save