check if record exists at import resolutionbasis
This commit is contained in:
parent
502b28fbc5
commit
a2784d9df2
|
|
@ -48,8 +48,9 @@ public function resolutionBasis(Request $request){
|
|||
$resolution['department_id'] = $entry['Department_ID'];
|
||||
$resolution['resolution_id'] = $entry['Resolution_ID'];
|
||||
$resolution['resolutionbasis'] = $entry['ResolutionBasis'];
|
||||
$resolution['foreign_id'] = $entry['ID'];
|
||||
|
||||
$res = Resolutionbasis::where('contract_id', $resolution['contract_id'])->first();
|
||||
$res = Resolutionbasis::where('foreign_id', $resolution['foreign_id'])->first();
|
||||
if($res == null){
|
||||
Resolutionbasis::create($resolution);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('resolutionbasis', function (Blueprint $table) {
|
||||
$table->bigInteger('foreign_id')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('resolutionbasis', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
};
|
||||
Loading…
Reference in New Issue