Files
lelong/database/migrations/2022_01_25_010223_create_payment_table.php
T
2022-08-09 09:32:24 +08:00

114 lines
4.3 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePaymentTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('payment', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('user_id')->unsigned();
$table->unsignedBigInteger('lelong_id')->unsigned();
$table->string('kodcaw')->nullable();
$table->string('norujukan')->nullable();
$table->string('back_acc_pembeli')->nullable();
$table->string('bank_acc_no_pembeli')->nullable();
$table->string('nama_bank_acc_caw')->nullable();
$table->string('bank_no_acc_caw')->nullable();
$table->integer('status_payment_opt')->nullable(); //1=kaunter,2=online,3=CDM
$table->integer('resit_id');
$table->integer('status'); //1 = fee RM10 , 2 = paybidifwin
$table->string('remark');
$table->integer('1sen')->nullable();
$table->integer('5sen')->nullable();
$table->integer('10sen')->nullable();
$table->integer('20sen')->nullable();
$table->integer('50sen')->nullable();
$table->integer('rm1')->nullable();
$table->integer('rm5')->nullable();
$table->integer('rm10')->nullable();
$table->integer('rm20')->nullable();
$table->integer('rm50')->nullable();
$table->integer('rm100')->nullable();
$table->decimal('total_payment', $precision = 11, $scale = 2);
$table->datetime('disahkan_pada')->nullable();
$table->integer('disahkan_oleh')->nullable();
$table->datetime('diminta_pada')->nullable();
$table->integer('diminta_oleh')->nullable();
$table->timestamps();
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
$table->foreign('lelong_id')
->references('id')->on('lelong')
->onDelete('cascade');
});
Schema::create('resit', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('user_id')->unsigned();
$table->unsignedBigInteger('lelong_id')->unsigned();
$table->string('reference_no')->nullable();
$table->integer('invoice_id')->nullable();
$table->string('invoice_no')->nullable();
$table->string('billplz_id');
$table->decimal('total_payment', $precision = 11, $scale = 2);
$table->string('resit_type'); // 1 = fee , 2 = bid
$table->string('status')->nullable(); //status => 1 = paid , 2 = pending
$table->timestamp('paid_at')->nullable();
$table->timestamps();
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
$table->foreign('lelong_id')
->references('id')->on('lelong')
->onDelete('cascade');
});
Schema::create('invoice', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('user_id')->unsigned();
$table->unsignedBigInteger('lelong_id')->unsigned();
$table->string('invoice_no')->nullable();
$table->decimal('total_invoice', $precision = 11, $scale = 2);
$table->string('invoice_type'); // 1 = fee , 2 = bid
$table->string('status')->nullable(); //status => 1 = paid , 2 = pending
$table->timestamp('paid_at')->nullable();
$table->timestamps();
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
$table->foreign('lelong_id')
->references('id')->on('lelong')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('payment');
Schema::dropIfExists('resit');
Schema::dropIfExists('invoice');
}
}