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

This commit is contained in:
珂珂 2024-11-29 14:39:52 +08:00
parent 40f2366c9d
commit 8fc89088e4
2 changed files with 3 additions and 5 deletions

View File

@ -27,9 +27,6 @@ public function handle()
} }
} }
// public function action_contact()
// {}
public function action_mail_test() public function action_mail_test()
{ {
$users = Contact::query()->get(); $users = Contact::query()->get();
@ -69,7 +66,7 @@ public function action_push_missing()
continue; continue;
} }
$contact = $contacts[$offset]; $contact = $contacts[$offset];
// $item->update(['status' => Testdrive::STATUS_PUBLISHED, 'contact_id' => $contact->id, 'contact_info' => $contact->toArray()]); $item->update(['status' => Testdrive::STATUS_PUBLISHED, 'contact_id' => $contact->id, 'contact_info' => $contact->toArray()]);
if (!isset($sendList[$contact->id])) { if (!isset($sendList[$contact->id])) {
$sendList[$contact->id] = [$item]; $sendList[$contact->id] = [$item];
} else { } else {
@ -83,7 +80,7 @@ public function action_push_missing()
$contact = $contacts->firstWhere('id', $contactId); $contact = $contacts->firstWhere('id', $contactId);
$this->info("发送试驾数据给联系人 {$contact->id} 总数 " . count($items)); $this->info("发送试驾数据给联系人 {$contact->id} 总数 " . count($items));
info("发送试驾数据给联系人 {$contact->id} 总数 " . count($items)); info("发送试驾数据给联系人 {$contact->id} 总数 " . count($items));
// $contact->notify(new TestdirveNotification($items)); $contact->notify(new TestdirveNotification($items));
} }
return Command::SUCCESS; return Command::SUCCESS;
} }

View File

@ -20,6 +20,7 @@ public function via(object $notifiable): array
public function toMail(object $notifiable): MailMessage public function toMail(object $notifiable): MailMessage
{ {
info('===== TestdirveNotification::toMail', ['items' => $this->items]);
$table = new HtmlString(view('bydauto::mail.testdrive', ['items' => $this->items])->render()); $table = new HtmlString(view('bydauto::mail.testdrive', ['items' => $this->items])->render());
return (new MailMessage()) return (new MailMessage())
->subject("预约试驾线索通知") ->subject("预约试驾线索通知")