From 8ea1011492522614249b7e26f28ae28930721d7c Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 7 Aug 2024 13:45:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=9F=A5=E8=AF=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/lists/store_product/StoreProductLists.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/admin/lists/store_product/StoreProductLists.php b/app/admin/lists/store_product/StoreProductLists.php index 338ab1517..cb942673f 100644 --- a/app/admin/lists/store_product/StoreProductLists.php +++ b/app/admin/lists/store_product/StoreProductLists.php @@ -10,6 +10,7 @@ use app\common\lists\ListsSearchInterface; use app\common\model\store_category\StoreCategory; use app\common\model\store_product_unit\StoreProductUnit; use app\common\model\system_store\SystemStore; +use app\common\model\warehouse_product_storege\WarehouseProductStorege; /** * 商品列表列表 @@ -64,6 +65,7 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa ->order(['id' => 'desc']) ->select()->each(function ($item) { $item['unit_name'] = StoreProductUnit::where('id', $item['unit'])->value('name'); + $item['stock'] = WarehouseProductStorege::where('product_id', $item['id'])->sum('nums'); $item['cate_name'] = StoreCategory::where('id', $item['cate_id'])->value('name'); return $item; })?->toArray();