From 030aa91c0a62743d25e1b5746ad9e669bd352c07 Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Mon, 2 Nov 2020 17:36:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E4=BB=B7=E5=95=86=E5=93=81=E5=BA=93?= =?UTF-8?q?=E5=AD=98=E4=B8=8D=E8=B6=B3=E6=9D=A1=E4=BB=B6=E5=88=A4=E6=96=AD?= =?UTF-8?q?=20=E5=8A=A0=E4=B8=8Aredis=E5=8E=8B=E7=9A=84=E5=BA=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Model/v3/GoodsActivity.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Model/v3/GoodsActivity.php b/app/Model/v3/GoodsActivity.php index c3097ea..7d3a950 100644 --- a/app/Model/v3/GoodsActivity.php +++ b/app/Model/v3/GoodsActivity.php @@ -87,9 +87,12 @@ class GoodsActivity extends Model { $msg = ''; + // 获取冻结的库存 + $inventoryFrozen = $this->goodsInventoryService->getSold(2, $this->attributes['id']); + if ($this->attributes['expire_time'] < time()) { $msg = '已结束'; - } elseif ($this->attributes['inventory'] <= 0 && $this->attributes['is_infinite'] != 1) { + } elseif ($this->attributes['inventory'] <= $inventoryFrozen && $this->attributes['is_infinite'] != 1) { $msg = '已抢光'; } return $msg;