优化商品SPU和SKU表
parent
f463805d73
commit
de5a97ac3a
|
|
@ -21,6 +21,5 @@ class ProductSku extends Model
|
||||||
'user_price' => Price::class,
|
'user_price' => Price::class,
|
||||||
'attrs' => JsonArray::class,
|
'attrs' => JsonArray::class,
|
||||||
'is_sell' => 'bool',
|
'is_sell' => 'bool',
|
||||||
'is_recommend' => 'bool',
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,5 @@ class ProductSpu extends Model
|
||||||
'user_price' => Price::class,
|
'user_price' => Price::class,
|
||||||
'attrs' => JsonArray::class,
|
'attrs' => JsonArray::class,
|
||||||
'is_sell' => 'bool',
|
'is_sell' => 'bool',
|
||||||
'is_recommend' => 'bool',
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,9 @@ class CreateProductSpusTable extends Migration
|
||||||
$table->integer('weight')->unsigned()->nullable()->comment('重量:g');
|
$table->integer('weight')->unsigned()->nullable()->comment('重量:g');
|
||||||
$table->json('attrs')->nullable()->comment('属性文本');
|
$table->json('attrs')->nullable()->comment('属性文本');
|
||||||
$table->tinyInteger('is_sell')->unsigned()->default(0)->comment('在售状态');
|
$table->tinyInteger('is_sell')->unsigned()->default(0)->comment('在售状态');
|
||||||
$table->tinyInteger('is_recommend')->unsigned()->default(0)->comment('是否推荐');
|
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|
||||||
|
$table->index('category_id');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@ class CreateProductSpuSpecsTable extends Migration
|
||||||
*/
|
*/
|
||||||
$table->json('items')->nullable()->comment('规格值');
|
$table->json('items')->nullable()->comment('规格值');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|
||||||
|
$table->index('product_spu_id');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,13 +30,13 @@ class CreateProductSkusTable extends Migration
|
||||||
$table->integer('weight')->unsigned()->nullable()->comment('重量:g');
|
$table->integer('weight')->unsigned()->nullable()->comment('重量:g');
|
||||||
$table->json('attrs')->nullable()->comment('属性文本');
|
$table->json('attrs')->nullable()->comment('属性文本');
|
||||||
$table->tinyInteger('is_sell')->unsigned()->default(0)->comment('在售状态');
|
$table->tinyInteger('is_sell')->unsigned()->default(0)->comment('在售状态');
|
||||||
$table->tinyInteger('is_recommend')->unsigned()->default(0)->comment('是否推荐');
|
|
||||||
$table->json('spec_items')->nullable()->comment('规格属性');
|
$table->json('spec_items')->nullable()->comment('规格属性');
|
||||||
$table->integer('stock')->unsigned()->default(0)->comment('库存');
|
$table->integer('stock')->unsigned()->default(0)->comment('库存');
|
||||||
$table->integer('sells')->unsigned()->default(0)->comment('销量');
|
$table->integer('sells')->unsigned()->default(0)->comment('销量');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|
||||||
$table->index('spu_id');
|
$table->index('spu_id');
|
||||||
|
$table->index('category_id');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue