increments('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(['store_id', 'product_id'], 'cart_store_product_unique'); $table->index(['store_id', 'created_at'], 'cart_store_created_index'); $table->comment('小程序购物车表(门店订货车)'); }); } } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('cart'); } };