TmpAddSingleJob.php 720 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\Jobs;
  3. use Illuminate\Bus\Queueable;
  4. use Illuminate\Queue\SerializesModels;
  5. use Illuminate\Queue\InteractsWithQueue;
  6. use Illuminate\Contracts\Queue\ShouldQueue;
  7. use Yunshop\SingleReturn\models\ReturnSingleModel;
  8. class TmpAddSingleJob implements ShouldQueue
  9. {
  10. use InteractsWithQueue, Queueable, SerializesModels;
  11. protected $tmpSingleData;
  12. /**
  13. * Create a new job instance.
  14. *
  15. * @return void
  16. */
  17. public function __construct($tmpSingleData)
  18. {
  19. $this->tmpSingleData = $tmpSingleData;
  20. }
  21. /**
  22. * Execute the job.
  23. *
  24. * @return void
  25. */
  26. public function handle()
  27. {
  28. ReturnSingleModel::insert($this->tmpSingleData);
  29. }
  30. }