【程序目录】优化生成图片流程

This commit is contained in:
吴昊天 2022-11-29 15:02:47 +08:00
parent ebf9dd9c52
commit 0afffdcf98
2 changed files with 8 additions and 2 deletions

View File

@ -201,11 +201,11 @@ class StoreOrderComputedServices extends BaseServices
if (!$flag) {
throw new ApiException(410243);
}
$payPrice = (float)bcsub((string)$payPrice, (string)$couponInfo['coupon_price'], 2);
if ($isCreate) {
$res1 = $couponServices->useCoupon($couponId);
}
$couponPrice = $couponInfo['coupon_price'];
$couponPrice = $couponInfo['coupon_price'] > $price ? $price : $couponInfo['coupon_price'];
$payPrice = (float)bcsub((string)$payPrice, (string)$couponPrice, 2);
} else {
$couponPrice = 0;
}

View File

@ -74,8 +74,14 @@ class DownloadImage
if (!$name) {
//TODO 获取要下载的文件名称
$downloadImageInfo = $this->getImageExtname($url);
$ext = $downloadImageInfo['ext_name'];
$name = $downloadImageInfo['file_name'];
if (!$name) throw new AdminException(400725);
} else {
$ext = $this->getImageExtname($name)['ext_name'];
}
if (in_array($ext, ['php', 'js', 'html'])) {
throw new AdminException(400558);
}
if (strstr($url, 'http://') === false && strstr($url, 'https://') === false) {
$url = 'http:' . $url;