| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace App\Services;
- use App\PrintTemplate;
- use App\Traits\DrawImage;
- use App\Traits\ModelSearchWay;
- use App\Traits\ServiceAppAop;
- use Illuminate\Support\Str;
- use Intervention\Image\Facades\Image;
- class PrintService
- {
- use ModelSearchWay;
- use ServiceAppAop;
- use DrawImage;
- /**
- * 处理打印参数 返回 打印图片
- * @param array $params
- * @return mixed
- */
- public function processingPrintData(array $params)
- {
- // $img_name = Str::uuid().'.png';
- // $path_arr = ['app','public','print'];
- // $dir_path = implode(DIRECTORY_SEPARATOR,$path_arr);
- // if (!file_exists(storage_path($dir_path))) mkdir(storage_path($dir_path));
- //
- // $path_arr[] = 'image';
- // $dir_path = implode(DIRECTORY_SEPARATOR,$path_arr);
- // if (!file_exists(storage_path($dir_path))) mkdir(storage_path($dir_path));
- //
- // $path_arr[] = $img_name;
- // $path = storage_path(implode(DIRECTORY_SEPARATOR,$path_arr));
- //
- // $img->save($path); // 图片保存
- // $file = file_get_contents($path);
- }
- }
|