From c9e57c85b861a088901cc2cedf890bef7c9c7561 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 3 Mar 2025 15:12:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(store=5Fproduct):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=95=86=E5=93=81=E6=81=A2=E5=A4=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在恢复商品时,使用 withTrashed() 方法确保软删除的商品也能被更新 - 这个修改确保了商品及其关联的分店商品记录都能正确地恢复 --- app/admin/logic/store_product/StoreProductLogic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/admin/logic/store_product/StoreProductLogic.php b/app/admin/logic/store_product/StoreProductLogic.php index 003b94b3..e4ef4e35 100644 --- a/app/admin/logic/store_product/StoreProductLogic.php +++ b/app/admin/logic/store_product/StoreProductLogic.php @@ -306,7 +306,7 @@ class StoreProductLogic extends BaseLogic throw new BusinessException('数据不存在'); } $res = $data->restore(); - StoreBranchProduct::where('product_id', $params['id'])->update(['delete_time' => null]); + StoreBranchProduct::where('product_id', $params['id'])->withTrashed()->update(['delete_time' => null]); return $res; }