Selaa lähdekoodia

Create suppliers and referral tables

master
Immanuel Onyeka 3 vuotta sitten
vanhempi
commit
4c00da7719
5 muutettua tiedostoa jossa 98 lisäystä ja 8 poistoa
  1. +18
    -5
      app/Console/Commands/ServicesInit.php
  2. +1
    -0
      database/migrations/2014_10_12_000000_create_users_table.php
  3. +1
    -3
      database/migrations/2021_05_18_184617_create_services_table.php
  4. +40
    -0
      database/migrations/2021_06_23_145817_create_suppliers_table.php
  5. +38
    -0
      database/migrations/2021_06_24_135121_create_referrals_table.php

+ 18
- 5
app/Console/Commands/ServicesInit.php Näytä tiedosto

@@ -54,7 +54,7 @@ class ServicesInit extends Command
$s->supplier_id = 2997;
$s->maximum = 500000;
$s->minimum = 1000;
$s->price = 600;
$s->price = 750;
$s->available = true;
$s->save();

@@ -107,7 +107,7 @@ class ServicesInit extends Command
$s->supplier = 'smmkings';
$s->maximum = 500000;
$s->minimum = 10;
$s->price = 2000;
$s->price = 7500;
$s->available = true;
$s->save();

@@ -175,6 +175,19 @@ class ServicesInit extends Command
$s->price = 50;
$s->available = true;
$s->save();

$s = new Service;
$s->name = 'Followers';
$s->type = 'followers';
$s->site = 'instagram';
$s->supplier = 'smmkings';
$s->supplier_id = 3882;
$s->maximum = 100000;
$s->minimum = 10;
$s->price = 410;
$s->available = true;
$s->save();

}

protected function twitter() {
@@ -198,7 +211,7 @@ class ServicesInit extends Command
$s->supplier_id = 288;
$s->maximum = 1000000;
$s->minimum = 100;
$s->price = 500;
$s->price = 700;
$s->available = true;
$s->save();

@@ -210,7 +223,7 @@ class ServicesInit extends Command
$s->supplier_id = 3820;
$s->maximum = 10000;
$s->minimum = 10;
$s->price = 400;
$s->price = 600;
$s->available = true;
$s->save();
}
@@ -237,7 +250,7 @@ class ServicesInit extends Command
$s->supplier_id = 3935;
$s->maximum = 100000;
$s->minimum = 100;
$s->price = 300;
$s->price = 400;
$s->available = true;
$s->save();



+ 1
- 0
database/migrations/2014_10_12_000000_create_users_table.php Näytä tiedosto

@@ -25,6 +25,7 @@ class CreateUsersTable extends Migration
$table->boolean('active')->default(true);
$table->boolean('paying')->default(false);
$table->unsignedBigInteger('credits')->default(0);
$table->integer('referral')->nullable();
$table->rememberToken();
$table->timestamps();
});


+ 1
- 3
database/migrations/2021_05_18_184617_create_services_table.php Näytä tiedosto

@@ -21,10 +21,8 @@ class CreateServicesTable extends Migration
$table->string('type')->nullable();
$table->string('site');
$table->string('note')->nullable();
$table->string('supplier')->nullable();
$table->integer('supplier_id')->nullable();
$table->string('supplier_link')->nullable();
$table->string('modifier')->default('');
$table->unsignedInteger('primary_supplier');
$table->integer('maximum');
$table->integer('minimum');
$table->integer('price');


+ 40
- 0
database/migrations/2021_06_23_145817_create_suppliers_table.php Näytä tiedosto

@@ -0,0 +1,40 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSuppliersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('suppliers', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->foreignId('service_id')->constrained();
$table->string('supplier')->nullable();
$table->string('supplier_name')->nullable();
$table->string('supplier_link')->nullable();
$table->integer('supplier_id')->nullable();
$table->integer('alternate_id')->nullable();
$table->integer('cost');
$table->integer('remaining')->nullable();
$table->text('description')->default('');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('suppliers');
}
}

+ 38
- 0
database/migrations/2021_06_24_135121_create_referrals_table.php Näytä tiedosto

@@ -0,0 +1,38 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateReferralsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('referrals', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->string('name');
$table->string('email');
$table->integer('rate')->default(25); //Percentage
$table->integer('limit')->default(20000); //Total limit in cents
$table->unsignedInteger('balance')->default(0);
$table->unsignedInteger('total')->default(0);
$table->boolean('active')->default(true);
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('referals');
}
}

Loading…
Peruuta
Tallenna