修改商品库存查询的错误

This commit is contained in:
lewis 2025-03-06 17:01:18 +08:00
parent a00173be2e
commit 703356cc3c

View File

@ -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) {