From 4cc1ab4629a763871144c00cbf2601d746cd815a Mon Sep 17 00:00:00 2001 From: panliang <1163816051@qq.com> Date: Fri, 15 Jul 2022 12:21:18 +0800 Subject: [PATCH] sku --- app/Models/ProductSku.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/ProductSku.php b/app/Models/ProductSku.php index c931a4f7..c552baf0 100644 --- a/app/Models/ProductSku.php +++ b/app/Models/ProductSku.php @@ -161,7 +161,7 @@ class ProductSku extends Model public function getSaleableStockAttribute(): int { if ($this->isOnline()) { - if ($this->is_pre_sale || $this->spu->is_pre_sale) { + if ($this->is_pre_sale || $this->spu?->is_pre_sale) { return 99999; } return $this->attributes['stock'];