SpreadsheetExcelJob.php 558 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace ln\jobs;
  3. use ln\interfaces\JobInterface;
  4. use think\facade\Log;
  5. use think\queue\Job;
  6. use ln\services\ExcelService;
  7. class SpreadsheetExcelJob implements JobInterface
  8. {
  9. public function fire($job, $data)
  10. {
  11. try{
  12. app()->make(ExcelService::class)->getAll($data);
  13. }catch (\Exception $e){
  14. Log::info('导出文件:'.$data['type'].'; error : ' . $e->getMessage());
  15. }
  16. $job->delete();
  17. }
  18. public function failed($data)
  19. {
  20. // TODO: Implement failed() method.
  21. }
  22. }