From 25a3e9bb63fe83f7c82180a7d373a331b2f41acb Mon Sep 17 00:00:00 2001
From: huangsijun <1773182001@qq.com>
Date: Thu, 06 Nov 2025 11:33:03 +0800
Subject: [PATCH] 更新前端订单详情获取的处理,增加判断是不是订单号过来的
---
admin/app/common/service/business/Poster.php | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/admin/app/common/service/business/Poster.php b/admin/app/common/service/business/Poster.php
index 8546466..1db14ca 100644
--- a/admin/app/common/service/business/Poster.php
+++ b/admin/app/common/service/business/Poster.php
@@ -253,10 +253,17 @@
imagesavealpha($targetImage, true);
$bg = imagecolorallocatealpha($targetImage, 255, 255, 255, 127);
imagefill($targetImage, 0, 0, $bg);
- imagecopyresampled($targetImage, $image, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);
- imagepng($targetImage, $imageUrl,0); // 根据需要选择合适的函数(如imagepng、imagegif等)
+ imagecopyresampled($targetImage, $image, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height); // 保存时使用最高质量
+ $ext = pathinfo($imageUrl, PATHINFO_EXTENSION);
+ if ($ext == 'png'){
+ imagepng($targetImage, $imageUrl,0); // 根据需要选择合适的函数(如imagepng、imagegif等)
+ }else{
+ imagejpeg($targetImage, $imageUrl,100);
+ }
+
// 清理内存
imagedestroy($targetImage);
+ imagedestroy($image);
}
/**
@@ -529,9 +536,11 @@
* @return array
*/
private function SizeLeftTop($fontSize,$left,$top){
- $data[0] = $fontSize * 0.76;
- $data[1] = $left;
- $data[2] = $top + $fontSize;
+ // 正确的px到pt转换系数:1px = 0.75pt
+ // 使用0.75而不是0.76以确保字体大小显示准确
+ $data[0] = $fontSize * 0.75;
+ $data[1] = (float)$left;
+ $data[2] = (float)$top + $fontSize;
return $data;
}
--
Gitblit v1.9.2