6
0
Fork 0
panliang 2022-07-15 12:18:44 +08:00
parent 644be10419
commit 665e2b11cf
2 changed files with 6 additions and 3 deletions

View File

@ -161,6 +161,9 @@ class ProductSku extends Model
public function getSaleableStockAttribute(): int
{
if ($this->isOnline()) {
if ($this->is_pre_sale || $this->spu->is_pre_sale) {
return 99999;
}
return $this->attributes['stock'];
}

View File

@ -32,8 +32,8 @@ class AddIsPreSaleToProductSpus extends Migration
Schema::table('product_spus', function (Blueprint $table) {
$table->dropColumn(['is_pre_sale']);
});
// Schema::table('product_skus', function (Blueprint $table) {
// $table->dropColumn(['is_pre_sale']);
// });
Schema::table('product_skus', function (Blueprint $table) {
$table->dropColumn(['is_pre_sale']);
});
}
}