promotion 1.0
This commit is contained in:
parent
1cc8e025a1
commit
570d428b1c
60 changed files with 1596 additions and 272 deletions
|
|
@ -30,7 +30,6 @@ class CreateShoppingOrdersTable extends Migration
|
|||
$table->decimal('discount', 13, 2)->nullable();
|
||||
$table->decimal('subtotal', 13, 2)->nullable();
|
||||
|
||||
|
||||
$table->decimal('shipping', 8, 2)->nullable();
|
||||
$table->decimal('shipping_net', 8, 2)->nullable();
|
||||
|
||||
|
|
@ -55,7 +54,8 @@ class CreateShoppingOrdersTable extends Migration
|
|||
$table->string('txaction', 20)->nullable()->index();
|
||||
$table->unsignedTinyInteger('shipped')->default(0);
|
||||
$table->timestamp('shipped_at')->nullable();
|
||||
|
||||
$table->string('shipping_option', 20)->nullable()->index();
|
||||
|
||||
$table->string('tracking', 255)->nullable();
|
||||
|
||||
$table->char('mode', 4)->nullable();
|
||||
|
|
|
|||
|
|
@ -21,12 +21,11 @@ class CreateShoppingOrderItemsTable extends Migration
|
|||
$table->unsignedInteger('product_id');
|
||||
|
||||
$table->unsignedTinyInteger('comp')->nullable();
|
||||
|
||||
$table->unsignedTinyInteger('free_product')->nullable();
|
||||
|
||||
$table->unsignedInteger('qty');
|
||||
$table->decimal('price', 8, 2)->nullable();
|
||||
$table->decimal('price_net', 8, 3)->nullable();
|
||||
|
||||
$table->decimal('tax_rate', 5, 2)->nullable();
|
||||
$table->string('slug')->nullable();
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ class CreatePromotionAdminsTable extends Migration
|
|||
|
||||
$table->string('name', 255);
|
||||
$table->text('description')->nullable();
|
||||
$table->text('user_description')->nullable();
|
||||
$table->text('user_about')->nullable();
|
||||
|
||||
$table->date('from')->nullable();
|
||||
$table->date('to')->nullable();
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ class CreatePromotionUserProductsTable extends Migration
|
|||
public function up()
|
||||
{
|
||||
Schema::create('promotion_user_products', function (Blueprint $table) {
|
||||
|
||||
$table->increments('id');
|
||||
|
||||
$table->unsignedInteger('promotion_admin_id')->index();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePromotionUserOrdersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('promotion_user_orders', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
|
||||
$table->unsignedInteger('promotion_admin_id')->index();
|
||||
$table->unsignedInteger('promotion_user_id')->index();
|
||||
$table->unsignedInteger('promotion_user_product_id')->index();
|
||||
$table->unsignedInteger('product_id')->index();
|
||||
$table->unsignedInteger('shopping_order_item_id')->index();
|
||||
$table->unsignedInteger('shopping_order_id')->index();
|
||||
$table->unsignedInteger('shopping_user_id')->index();
|
||||
|
||||
$table->unsignedSmallInteger('qty')->nullable();
|
||||
$table->decimal('price', 8, 2)->nullable();
|
||||
$table->decimal('price_net', 8, 3)->nullable();
|
||||
$table->decimal('tax_rate', 5, 2)->nullable();
|
||||
|
||||
$table->unsignedTinyInteger('status')->index()->default(0);
|
||||
|
||||
$table->foreign('promotion_admin_id')
|
||||
->references('id')
|
||||
->on('promotion_admins');
|
||||
|
||||
$table->foreign('promotion_user_id')
|
||||
->references('id')
|
||||
->on('promotion_users');
|
||||
|
||||
$table->foreign('promotion_user_product_id')
|
||||
->references('id')
|
||||
->on('promotion_user_products');
|
||||
|
||||
$table->foreign('product_id')
|
||||
->references('id')
|
||||
->on('products');
|
||||
|
||||
$table->foreign('shopping_order_item_id')
|
||||
->references('id')
|
||||
->on('shopping_order_items');
|
||||
|
||||
$table->foreign('shopping_order_id')
|
||||
->references('id')
|
||||
->on('shopping_orders');
|
||||
|
||||
$table->foreign('shopping_user_id')
|
||||
->references('id')
|
||||
->on('shopping_users');
|
||||
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('promotion_user_orders');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue