From 31724b36603968259d004be01c6f38c4b4a590a8 Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Thu, 21 Jul 2022 16:17:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=A8=8E=E8=B4=B9=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2022_07_21_073835_create_tax.php | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 database/migrations/2022_07_21_073835_create_tax.php diff --git a/database/migrations/2022_07_21_073835_create_tax.php b/database/migrations/2022_07_21_073835_create_tax.php new file mode 100644 index 00000000..b481d241 --- /dev/null +++ b/database/migrations/2022_07_21_073835_create_tax.php @@ -0,0 +1,68 @@ +id(); + $table->string('name'); + $table->string('description'); + $table->timestamps(); + }); + + // 区域组与国家省市县关联表 + Schema::create('region_zones', function (Blueprint $table) { + $table->id(); + $table->integer('region_id'); + $table->integer('country_id'); + $table->integer('zone_id'); + $table->timestamps(); + }); + + + Schema::create('tax_classes', function (Blueprint $table) { + $table->id(); + $table->string('title'); + $table->string('description'); + $table->timestamps(); + }); + + Schema::create('tax_rates', function (Blueprint $table) { + $table->id(); + $table->integer('region_id'); + $table->string('name'); + $table->string('rate'); + $table->enum('type', ['percent', 'flat']); + $table->timestamps(); + }); + + Schema::create('tax_rules', function (Blueprint $table) { + $table->id(); + $table->integer('tax_class_id'); + $table->integer('tax_rate_id'); + $table->enum('based', ['store', 'payment', 'shipping']); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + + } +}