dev
All checks were successful
Deploy to Production / deploy (push) Successful in 14s

This commit is contained in:
珂珂 2024-12-09 15:18:18 +08:00
parent 9c0f0b7116
commit 669b0cbfce

View File

@ -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;