|
|
|
@ -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; |
|
|
|
|