SpreadsheetExcelJob.php 639 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * @package merchant
  4. *
  5. * @author xaboy
  6. * @day 2020-05-08
  7. *
  8. *
  9. */
  10. namespace crmeb\jobs;
  11. use crmeb\interfaces\JobInterface;
  12. use think\facade\Log;
  13. use think\queue\Job;
  14. use crmeb\services\ExcelService;
  15. class SpreadsheetExcelJob implements JobInterface
  16. {
  17. public function fire($job, $data)
  18. {
  19. try{
  20. app()->make(ExcelService::class)->getAll($data);
  21. }catch (\Exception $e){
  22. Log::info('导出文件:'.$data['type'].'; error : ' . $e->getMessage());
  23. }
  24. $job->delete();
  25. }
  26. public function failed($data)
  27. {
  28. // TODO: Implement failed() method.
  29. }
  30. }