add verification status

This commit is contained in:
Nazri
2018-05-22 17:29:12 +08:00
parent b2fc9f8605
commit 90e88039f4
4 changed files with 67 additions and 9 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model;
class Booking extends Model
{
// protected $guarded = [];
protected $fillable = ['term', 'amount', 'rate_id', 'user_id', 'account_name', 'account_num', 'bank_name', 'bank_branch', 'company_name', 'company_address', 'bank_address', 'swift_code', 'cnap' ];
protected $fillable = ['term', 'amount', 'rate_id', 'user_id', 'account_name', 'account_num', 'bank_name', 'bank_branch', 'company_name', 'company_address', 'bank_address', 'swift_code', 'cnap' ,'verification_status'];
public $timestamps = true;
public function user(){
return $this->belongsTo('app\User');
+11 -3
View File
@@ -68,8 +68,15 @@ class BookingController extends Controller
//Calculation part
// $bookings = Booking::all();
$amount = $request->input("amount");
$svcharge=20.00;
$amount = $request->input("amount");
if ($amount >= 10000 && ($term == 'x2_cash' || $term = 'x2_cheque' || $term = 'x2_ba')) {
$svcharge = 0;
}
else {
$svcharge = 20.00;
}
$bia = round(($amount + ($svcharge / $rate) + 0.06), 2);
// return $bia;
@@ -145,7 +152,8 @@ class BookingController extends Controller
$book_id->save();
return response()->json(['book_id'=>$book_id],200);
}
@@ -0,0 +1,50 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddBookingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('bookings', function (Blueprint $table) {
$table->double('rmb_book_amount')->nullable();
$table->string('rmb_book_pay_method')->nullable();
$table->string('rmb_book_account_name')->nullable();
$table->string('rmb_book_bank_name')->nullable();
$table->string('rmb_book_acc_no')->nullable();
$table->string('rmb_book_bank_branch')->nullable();
$table->double('usd_book_amount')->nullable();
$table->string('usd_book_pay_method')->nullable();
$table->string('usd_book_company_name')->nullable();
$table->string('usd_book_company_address')->nullable();
$table->string('usd_book_swift_code')->nullable();
$table->string('usd_book_cnap')->nullable();
$table->string('usd_book_bank_branch')->nullable();
$table->boolean('verification_status', true); // Results in a default value of 1.
// $table->foreign('status_id')
// ->references('id')->on('status')
// ->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('bookings', function (Blueprint $table) {
//
});
}
}
+5 -5
View File
@@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInitcf93d959a701f2cce72413258326eb20
class ComposerStaticInitebee75b176540aeb1d879b30f69e9dfc
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@@ -4321,10 +4321,10 @@ class ComposerStaticInitcf93d959a701f2cce72413258326eb20
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitcf93d959a701f2cce72413258326eb20::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitcf93d959a701f2cce72413258326eb20::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInitcf93d959a701f2cce72413258326eb20::$prefixesPsr0;
$loader->classMap = ComposerStaticInitcf93d959a701f2cce72413258326eb20::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitebee75b176540aeb1d879b30f69e9dfc::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitebee75b176540aeb1d879b30f69e9dfc::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInitebee75b176540aeb1d879b30f69e9dfc::$prefixesPsr0;
$loader->classMap = ComposerStaticInitebee75b176540aeb1d879b30f69e9dfc::$classMap;
}, null, ClassLoader::class);
}