From bdd53f2ffa84ed059b9fb9cce5d22b1148d398c5 Mon Sep 17 00:00:00 2001 From: zcstatham <578322713@qq.com> Date: Thu, 1 Sep 2022 21:01:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E6=9E=B6=E5=8E=BB=E9=87=8D=E7=94=B5?= =?UTF-8?q?=E8=AF=9D=E5=8F=B7=E5=A4=84=E7=90=86=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/service/CarInfoHandle.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extend/service/CarInfoHandle.php b/extend/service/CarInfoHandle.php index a40df81..7de4ec1 100644 --- a/extend/service/CarInfoHandle.php +++ b/extend/service/CarInfoHandle.php @@ -373,9 +373,11 @@ class CarInfoHandle if (count($phones) <= 6) { array_shift($phones); 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); - if (empty($source_a[$key])) + if (empty($source_a[$key]) || empty($phones)) break; } CarInfoT::where('id', $source_a['id'])->update($source_a);