diff --git a/app/Service/v3/Implementations/GoodsActivityService.php b/app/Service/v3/Implementations/GoodsActivityService.php index 8bb0ca1..68becdd 100644 --- a/app/Service/v3/Implementations/GoodsActivityService.php +++ b/app/Service/v3/Implementations/GoodsActivityService.php @@ -59,7 +59,7 @@ class GoodsActivityService implements GoodsActivityServiceInterface if (!$redis->exists($inventoryKey)) { $redis->set($inventoryKey, $num); } else { - $redis->incrBy($inventoryKey, $num); + $redis->incrBy($inventoryKey, intval($num)); } // 是否超过限购数量 diff --git a/app/Service/v3/Implementations/GoodsService.php b/app/Service/v3/Implementations/GoodsService.php index cb40273..3a7f0bb 100644 --- a/app/Service/v3/Implementations/GoodsService.php +++ b/app/Service/v3/Implementations/GoodsService.php @@ -49,7 +49,7 @@ class GoodsService implements GoodsServiceInterface if (!$redis->exists($inventoryKey)) { $redis->set($inventoryKey, $num); } else { - $redis->incrBy($inventoryKey, $num); + $redis->incrBy($inventoryKey, intval($num)); } // 是否超过限购数量