diff --git a/app/admin/lists/store_product/StoreProductLists.php b/app/admin/lists/store_product/StoreProductLists.php index d1201c4c..de7a7cdb 100644 --- a/app/admin/lists/store_product/StoreProductLists.php +++ b/app/admin/lists/store_product/StoreProductLists.php @@ -138,9 +138,9 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa $category = StoreCategory::where('id', 'in', [$item['top_cate_id'], $item['two_cate_id'], $item['cate_id']])->column('name'); $item['cate_name'] = implode('/', $category); if ($is_warehouse == 1) { - $item['stock'] = WarehouseProductStorege::where('product_id', $item['id'])->sum('nums'); + $item['stock'] = WarehouseProductStorege::where('product_id', $item['id'])->where('warehouse_id', 1)->sum('nums'); } else { - $nums = WarehouseProductStorege::where('product_id', $item['id'])->sum('nums'); + $nums = WarehouseProductStorege::where('product_id', $item['id'])->where('warehouse_id', 1)->sum('nums'); $item['stock'] = bcadd($nums, $stock); } if ($userShip == 4) { diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index b421c5ca..fc89ae7a 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -89,6 +89,8 @@ class BeforehandOrderLogic extends BaseLogic unset($params['product_arr'][$k]); continue; } + $v['price'] = trim($v['price']); + $v['nums'] = trim($v['nums']); $total_prices = bcmul($v['price'], $v['nums'], 2); $datas[$k]['purchase'] = $v['purchase']; $datas[$k]['mark'] = $v['mark'] ?? ''; diff --git a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php index 0433816d..e5f83859 100644 --- a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php +++ b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php @@ -498,11 +498,11 @@ class PurchaseProductOfferLogic extends BaseLogic $purchaseOffer = []; $cartInfo = []; foreach ($params['product_arr'] as $product) { - $product['price'] = trim($product['price']); - $product['nums'] = trim($product['nums']); if ($product['product_id'] <= 0) { continue; } + $product['price'] = trim($product['price']); + $product['nums'] = trim($product['nums']); $cartInfo[] = [ 'bhoid' => $procurementOrder['id'], 'product_id' => $product['product_id'],