Kirin 3 years ago
parent
commit
e64cb09865
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/admin/model/store/StoreProductAttrValue.php

+ 2 - 2
app/admin/model/store/StoreProductAttrValue.php

@@ -58,8 +58,8 @@ class StoreProductAttrValue extends BaseModel
     {
         self::beginTrans();
         try {
-            StoreProduct::where('id', $info['product_id'])->inc('stock', $info['in_stock'])->update();
-            self::where('product_id', $info['product_id'])->where('bar_code', $info['bar_code'])->inc('stock', $info['in_stock'])->update();
+            StoreProduct::where('id', $info['product_id'])->inc('stock', (float)$info['in_stock'])->update();
+            self::where('product_id', $info['product_id'])->where('bar_code', $info['bar_code'])->inc('stock', (float)$info['in_stock'])->update();
             self::commitTrans();
         } catch (Exception $e) {
             self::setErrorInfo($e->getMessage(), true);