소스 검색

数据类型问题

lizhen_gitee 10 달 전
부모
커밋
af7a3fee20
2개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 2
      addons/unishop/controller/Order.php
  2. 2 2
      addons/unishop/extend/Product.php

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