|
|
@@ -330,6 +330,7 @@ class PurchaseController extends BaseController
|
|
|
if ($version >= 10) {
|
|
|
$stock = $currentInfo['stock'] ?? 0;
|
|
|
$stock = floatval($stock);
|
|
|
+ $stock = intval($stock);
|
|
|
$productId = $currentInfo['id'] ?? 0;
|
|
|
$productName = $currentInfo['name'] ?? '';
|
|
|
$num = $orderNum[$productId] && $orderNum[$productId]['num'] ? $orderNum[$productId]['num'] : 0;
|
|
|
@@ -355,14 +356,8 @@ class PurchaseController extends BaseController
|
|
|
$allNoStock = true;
|
|
|
foreach ($productList as $pKey => $pVal) {
|
|
|
$productId = $pVal['productId'] ?? 0;
|
|
|
- $productName = $pVal['name'] ?? '';
|
|
|
if (isset($changeList[$productId])) {
|
|
|
- //解决剩下0.5扎和2.5扎,出现的异常情况
|
|
|
$changeStock = $changeList[$productId];
|
|
|
- $changeStock = intval($changeStock);
|
|
|
- if ($changeStock < 1) {
|
|
|
- util::fail($productName . '不足1扎,不能下单');
|
|
|
- }
|
|
|
$productList[$pKey]['bigNum'] = $changeStock;
|
|
|
}
|
|
|
if ($productList[$pKey]['bigNum'] > 0) {
|