領収証発行サービス
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

43 行
889B

  1. <?php
  2. namespace App\Jobs\SMS;
  3. use App\Codes\QueueName;
  4. use App\Jobs\BaseJob;
  5. use App\Logic\SMS\SMSManager;
  6. use App\Models\SMSSendOrder;
  7. class SendSMS extends BaseJob
  8. {
  9. /**
  10. * Create a new job instance.
  11. *
  12. * @return void
  13. */
  14. public function __construct(private SMSSendOrder $order)
  15. {
  16. $this->onQueue(QueueName::SMS->value);
  17. }
  18. /**
  19. * Execute the job.
  20. *
  21. * @return void
  22. */
  23. public function handle(SMSManager $manager)
  24. {
  25. $ret = $manager->setOrder($this->order)
  26. ->send();
  27. if ($ret) {
  28. info(sprintf(
  29. "SMS送信依頼成功 address:%s order_id:%s",
  30. $this->order->phone_number,
  31. $this->order->id,
  32. ));
  33. } else {
  34. $this->fail(sprintf("SMS送信依頼失敗 order_id:%s", $this->order->id));
  35. }
  36. }
  37. }