6
0
Fork 0

优化商品SPU和SKU表

release
李静 2021-11-26 09:43:07 +08:00
parent f463805d73
commit de5a97ac3a
5 changed files with 5 additions and 4 deletions

View File

@ -21,6 +21,5 @@ class ProductSku extends Model
'user_price' => Price::class,
'attrs' => JsonArray::class,
'is_sell' => 'bool',
'is_recommend' => 'bool',
];
}

View File

@ -19,6 +19,5 @@ class ProductSpu extends Model
'user_price' => Price::class,
'attrs' => JsonArray::class,
'is_sell' => 'bool',
'is_recommend' => 'bool',
];
}

View File

@ -29,8 +29,9 @@ class CreateProductSpusTable extends Migration
$table->integer('weight')->unsigned()->nullable()->comment('重量:g');
$table->json('attrs')->nullable()->comment('属性文本');
$table->tinyInteger('is_sell')->unsigned()->default(0)->comment('在售状态');
$table->tinyInteger('is_recommend')->unsigned()->default(0)->comment('是否推荐');
$table->timestamps();
$table->index('category_id');
});
}

View File

@ -24,6 +24,8 @@ class CreateProductSpuSpecsTable extends Migration
*/
$table->json('items')->nullable()->comment('规格值');
$table->timestamps();
$table->index('product_spu_id');
});
}

View File

@ -30,13 +30,13 @@ class CreateProductSkusTable extends Migration
$table->integer('weight')->unsigned()->nullable()->comment('重量:g');
$table->json('attrs')->nullable()->comment('属性文本');
$table->tinyInteger('is_sell')->unsigned()->default(0)->comment('在售状态');
$table->tinyInteger('is_recommend')->unsigned()->default(0)->comment('是否推荐');
$table->json('spec_items')->nullable()->comment('规格属性');
$table->integer('stock')->unsigned()->default(0)->comment('库存');
$table->integer('sells')->unsigned()->default(0)->comment('销量');
$table->timestamps();
$table->index('spu_id');
$table->index('category_id');
});
}