Ver Fonte

数据类型问题

lizhen_gitee há 10 meses atrás
pai
commit
af7a3fee20

+ 2 - 2
addons/unishop/controller/Order.php

@@ -161,8 +161,8 @@ class Order extends Base
             /*$cityId = $address['city_id'] ? $address['city_id'] : 0;
             $delivery = (new DeliveryRuleModel())->getDelivetyByArea($cityId);*/
 
-            $order_price = 0;
-            $delivery_price = 0;
+            $order_price = '0';
+            $delivery_price = '0';
 
             foreach ($productData as &$product) {
                 $product['image'] = Config::getImagesFullUrl($product['image']);

+ 2 - 2
addons/unishop/extend/Product.php

@@ -36,8 +36,8 @@ class Product
                     if ($key) {
                         $data = $specItem[$key];
                     } else {
-                        $specItem['stock'] = intval($specItem['stock']);
-                        $specItem['sales'] = intval($specItem['sales']);
+                        $specItem['stock'] = intval($specItem['stock']);//数据类型
+                        $specItem['sales'] = intval($specItem['sales']);//数据类型
 
                         $data = $specItem;
                         $data['key'] = $k;