6
0
Fork 0
release
李静 2021-11-26 13:20:55 +08:00
parent de5a97ac3a
commit 5d1f06ed6d
4 changed files with 11 additions and 6 deletions

View File

@ -20,6 +20,7 @@ class ProductSku extends Model
'cost_price' => Price::class,
'user_price' => Price::class,
'attrs' => JsonArray::class,
'is_sell' => 'bool',
'specs' => 'json',
'online_at' => 'datetime',
];
}

View File

@ -18,6 +18,6 @@ class ProductSpu extends Model
'cost_price' => Price::class,
'user_price' => Price::class,
'attrs' => JsonArray::class,
'is_sell' => 'bool',
'online_at' => 'datetime',
];
}

View File

@ -28,10 +28,13 @@ class CreateProductSpusTable extends Migration
$table->string('media')->nullable()->comment('媒体地址');
$table->integer('weight')->unsigned()->nullable()->comment('重量:g');
$table->json('attrs')->nullable()->comment('属性文本');
$table->tinyInteger('is_sell')->unsigned()->default(0)->comment('在售状态');
$table->integer('stock')->unsigned()->default(0)->comment('库存');
$table->integer('sales')->unsigned()->default(0)->comment('销量');
$table->timestamp('online_at')->nullable()->comment('上线时间');
$table->timestamps();
$table->index('category_id');
$table->index('online_at');
});
}

View File

@ -29,14 +29,15 @@ class CreateProductSkusTable extends Migration
$table->string('media')->nullable()->comment('媒体地址');
$table->integer('weight')->unsigned()->nullable()->comment('重量:g');
$table->json('attrs')->nullable()->comment('属性文本');
$table->tinyInteger('is_sell')->unsigned()->default(0)->comment('在售状态');
$table->json('spec_items')->nullable()->comment('规格属性');
$table->json('specs')->nullable()->comment('规格属性');
$table->integer('stock')->unsigned()->default(0)->comment('库存');
$table->integer('sells')->unsigned()->default(0)->comment('销量');
$table->integer('sales')->unsigned()->default(0)->comment('销量');
$table->timestamp('online_at')->nullable()->comment('上线时间');
$table->timestamps();
$table->index('spu_id');
$table->index('category_id');
$table->index('online_at');
});
}