PrintService.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace App\Services;
  3. use App\PrintTemplate;
  4. use App\Traits\DrawImage;
  5. use App\Traits\ModelSearchWay;
  6. use App\Traits\ServiceAppAop;
  7. use Illuminate\Support\Str;
  8. use Intervention\Image\Facades\Image;
  9. class PrintService
  10. {
  11. use ModelSearchWay;
  12. use ServiceAppAop;
  13. use DrawImage;
  14. /**
  15. * 处理打印参数 返回 打印图片
  16. * @param array $params
  17. * @return mixed
  18. */
  19. public function processingPrintData(array $params)
  20. {
  21. // $img_name = Str::uuid().'.png';
  22. // $path_arr = ['app','public','print'];
  23. // $dir_path = implode(DIRECTORY_SEPARATOR,$path_arr);
  24. // if (!file_exists(storage_path($dir_path))) mkdir(storage_path($dir_path));
  25. //
  26. // $path_arr[] = 'image';
  27. // $dir_path = implode(DIRECTORY_SEPARATOR,$path_arr);
  28. // if (!file_exists(storage_path($dir_path))) mkdir(storage_path($dir_path));
  29. //
  30. // $path_arr[] = $img_name;
  31. // $path = storage_path(implode(DIRECTORY_SEPARATOR,$path_arr));
  32. //
  33. // $img->save($path); // 图片保存
  34. // $file = file_get_contents($path);
  35. }
  36. }