Kaynağa Gözat

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

吴昊天 3 yıl önce
ebeveyn
işleme
0afffdcf98

+ 2 - 2
crmeb/app/services/order/StoreOrderComputedServices.php

@@ -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;
         }

+ 6 - 0
crmeb/crmeb/utils/DownloadImage.php

@@ -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;