From 669b0cbfce57aa6764257baa5869dc46e412c8e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8F=82=E7=8F=82?= Date: Mon, 9 Dec 2024 15:18:18 +0800 Subject: [PATCH] dev --- packages/bydauto/src/Commands/BYDAutoCommand.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/bydauto/src/Commands/BYDAutoCommand.php b/packages/bydauto/src/Commands/BYDAutoCommand.php index b833eb4..926fa9a 100644 --- a/packages/bydauto/src/Commands/BYDAutoCommand.php +++ b/packages/bydauto/src/Commands/BYDAutoCommand.php @@ -114,6 +114,7 @@ public function action_push2contact() // ->orderBy('id') // ->get(); + $items = collect(); $num = $this->ask('ID 正序取出', 100); $items1 = Testdrive::query() ->whereNotNull('source') @@ -121,6 +122,7 @@ public function action_push2contact() ->orderBy('id') ->take($num) ->get(); + $items->push($items1); $num = $this->ask('ID 倒叙取出', 100); $items2 = Testdrive::query() @@ -129,12 +131,12 @@ public function action_push2contact() ->orderBy('id', 'desc') ->take($num) ->get(); + $items->push($items2); - $items2->merge($items1); // 根据手机号码去除重 - $items2 = $items2->unique('mobile'); + $items = $items->unique('mobile'); // 根据已发送的手机号码去重 - $items = $items2->filter(fn($item) => !in_array($item->mobile, $sendItems)); + $items = $items->filter(fn($item) => !in_array($item->mobile, $sendItems)); $confirm = $this->confirm("共有 {$items->count()} 条数据(已去重),是否继续?"); if (!$confirm) return Command::SUCCESS;