save order
This commit is contained in:
parent
d1dae9b736
commit
c20deac3fe
15 changed files with 739 additions and 301 deletions
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateShoppingUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('shopping_users', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
|
||||
$table->char('billing_salutation', 2)->nullable();
|
||||
$table->string('billing_company')->nullable();
|
||||
$table->string('billing_firstname')->nullable();
|
||||
$table->string('billing_lastname')->nullable();
|
||||
$table->string('billing_address')->nullable();
|
||||
$table->string('billing_address_2')->nullable();
|
||||
$table->string('billing_zipcode')->nullable();
|
||||
$table->string('billing_city')->nullable();
|
||||
$table->unsignedInteger('billing_country_id');
|
||||
$table->string('billing_phone')->nullable();
|
||||
$table->string('billing_email')->nullable();
|
||||
|
||||
$table->boolean('same_as_billing')->default(true);
|
||||
|
||||
$table->char('shipping_salutation', 2)->nullable();
|
||||
$table->string('shipping_company')->nullable();
|
||||
$table->string('shipping_firstname')->nullable();
|
||||
$table->string('shipping_lastname')->nullable();
|
||||
$table->string('shipping_address')->nullable();
|
||||
$table->string('shipping_address_2')->nullable();
|
||||
$table->string('shipping_zipcode')->nullable();
|
||||
$table->string('shipping_city')->nullable();
|
||||
$table->unsignedInteger('shipping_country_id');
|
||||
$table->string('shipping_phone')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('billing_country_id')
|
||||
->references('id')
|
||||
->on('countries');
|
||||
|
||||
$table->foreign('shipping_country_id')
|
||||
->references('id')
|
||||
->on('countries');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('shopping_users');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateShoppingOrdersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('shopping_orders', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
|
||||
$table->unsignedInteger('shopping_user_id');
|
||||
$table->unsignedInteger('country_id');
|
||||
$table->unsignedInteger('user_shop_id');
|
||||
|
||||
$table->decimal('total', 13, 2)->nullable();
|
||||
$table->decimal('shipping', 8, 2)->nullable();
|
||||
$table->decimal('subtotal', 13, 2)->nullable();
|
||||
$table->decimal('tax_rate', 5, 2)->nullable();
|
||||
$table->decimal('tax', 8, 2)->nullable();
|
||||
$table->decimal('total_shipping', 13, 2)->nullable();
|
||||
|
||||
$table->unsignedInteger('weight')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('shopping_user_id')
|
||||
->references('id')
|
||||
->on('shopping_users');
|
||||
|
||||
|
||||
$table->foreign('country_id')
|
||||
->references('id')
|
||||
->on('countries');
|
||||
|
||||
$table->foreign('user_shop_id')
|
||||
->references('id')
|
||||
->on('user_shops');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('shopping_orders');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateShoppingOrderItemsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('shopping_order_items', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
|
||||
$table->unsignedInteger('shopping_order_id');
|
||||
$table->unsignedInteger('product_id');
|
||||
$table->decimal('price', 8, 2)->nullable();
|
||||
$table->string('slug')->nullable();
|
||||
|
||||
$table->boolean('paid')->default(false);
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('shopping_order_id')
|
||||
->references('id')
|
||||
->on('shopping_orders');
|
||||
|
||||
$table->foreign('product_id')
|
||||
->references('id')
|
||||
->on('products');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('shopping_order_items');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateShoppingPaymentsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('shopping_payments', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
|
||||
$table->unsignedInteger('shopping_order_id');
|
||||
|
||||
$table->string('clearingtype',3);
|
||||
$table->string('wallettype', 3)->nullable();
|
||||
$table->string('onlinebanktransfertype',3)->nullable();
|
||||
|
||||
$table->string('reference', 20);
|
||||
$table->unsignedInteger('amount');
|
||||
$table->string('currency', 6);
|
||||
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('shopping_order_id')
|
||||
->references('id')
|
||||
->on('shopping_orders');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('shopping_payments');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreatePaymentTransactionsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('payment_transactions', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
|
||||
$table->unsignedInteger('shopping_payment_id');
|
||||
|
||||
$table->string('request',20);
|
||||
$table->unsignedInteger('txid');
|
||||
$table->unsignedInteger('userid');
|
||||
|
||||
$table->string('status',20)->nullable();;
|
||||
|
||||
|
||||
$table->string('key',40)->nullable();;
|
||||
$table->string('txaction',20)->nullable();;
|
||||
|
||||
$table->text('transmitted_data')->nullable();;
|
||||
|
||||
$table->unsignedInteger('errorcode')->nullable();;
|
||||
$table->string('errormessage')->nullable();;
|
||||
$table->string('customermessage')->nullable();;
|
||||
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('shopping_payment_id')
|
||||
->references('id')
|
||||
->on('shopping_payments');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('payment_transactions');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue