小程序用户改用门店登录
This commit is contained in:
@@ -8,19 +8,19 @@ return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
* 小程序购物车(门店订货车):按用户归属,同商品唯一行、加购合并累加
|
||||
* 小程序购物车(门店订货车):按门店归属,同商品唯一行、加购合并累加
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
if (! Schema::hasTable('cart')) {
|
||||
Schema::create('cart', function (Blueprint $table) {
|
||||
$table->increments('id')->comment('购物车项ID');
|
||||
$table->integer('user_id')->comment('用户ID(购物车归属者)');
|
||||
$table->integer('store_id')->comment('门店ID(购物车归属者)');
|
||||
$table->integer('product_id')->comment('商品ID');
|
||||
$table->decimal('quantity', 10, 2)->default(0)->comment('订货量');
|
||||
$table->timestamps();
|
||||
$table->unique(['user_id', 'product_id'], 'cart_user_product_unique');
|
||||
$table->index(['user_id', 'created_at'], 'cart_user_created_index');
|
||||
$table->unique(['store_id', 'product_id'], 'cart_store_product_unique');
|
||||
$table->index(['store_id', 'created_at'], 'cart_store_created_index');
|
||||
$table->comment('小程序购物车表(门店订货车)');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user