From 55ec2b4cd2b55589fa548700c002df6bbc685e65 Mon Sep 17 00:00:00 2001 From: zcstatham <578322713@qq.com> Date: Tue, 30 Aug 2022 00:09:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B5=E8=AF=9D=E5=8E=BB=E9=87=8D=E8=B0=83?= =?UTF-8?q?=E8=AF=952?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/service/CarInfoHandle.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/extend/service/CarInfoHandle.php b/extend/service/CarInfoHandle.php index ad0c6d9..0954aa4 100644 --- a/extend/service/CarInfoHandle.php +++ b/extend/service/CarInfoHandle.php @@ -183,16 +183,8 @@ class CarInfoHandle ['car_phone', '<>', ''], ['car_phone', 'REGEXP', '^1[3-9][0-9]{9}$'] ]; - $map = []; - if (isset($data['export_date1']) && $data['export_date1'] != '') { - $map[] = ['register_date', '>=', $data['export_date1']]; - } - if (isset($data['export_date2']) && $data['export_date2'] != '') { - $map[] = ['register_date', '<=', $data['export_date2']]; - } $query = CarInfoT::field('car_phone,count(*) as count') ->where($where) - ->where($map) ->group('car_phone'); $count = $query->count(); echo '总计:' . $count . PHP_EOL; @@ -200,11 +192,11 @@ class CarInfoHandle $peer_phone_number = $data['peer_phone_number']; $peer_phone_count = $repeat_count = 0; cache('shell_process_' . $id, 0, 300); - $query->chunk(3000, function ($infos) use (&$current, &$peer_phone_count, &$repeat_count, $count, $id, $peer_phone_number, $map) { + $query->chunk(3000, function ($infos) use (&$current, &$peer_phone_count, &$repeat_count, $count, $id, $peer_phone_number) { $insert_data = []; foreach ($infos as $item) { if ($item->count >= $peer_phone_number) { - $card_ids = CarInfoT::where('car_phone', $item->car_phone)->where($map)->column('car_number'); + $card_ids = CarInfoT::where('car_phone', $item->car_phone)->column('car_number'); if (count(array_flip(array_flip($card_ids))) <= 1) { continue; }