@@ -14,10 +14,12 @@ class AuditCustomer extends Model
|
||||
'username',
|
||||
'old_data',
|
||||
'new_data',
|
||||
'kodkerja',
|
||||
'nota_pekerjaan',
|
||||
'kodcaw',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'customer_name',
|
||||
'customer_nokp',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ class Customer extends Model
|
||||
'tagperingatan',
|
||||
'kumpulan',
|
||||
'telefon2',
|
||||
'nota_pekerjaan',
|
||||
'tagpelanggan'
|
||||
];
|
||||
|
||||
|
||||
@@ -345,6 +345,7 @@ class CustomerController extends Controller
|
||||
'nosiri'=>$request->nosiri,
|
||||
'nota'=>$request->nota,
|
||||
'kodkerja'=>$request->kodkerja,
|
||||
'nota_pekerjaan'=>$request->nota_pekerjaan,
|
||||
'tujuangadai'=>$request->tujuangadai
|
||||
]);
|
||||
|
||||
@@ -362,6 +363,8 @@ class CustomerController extends Controller
|
||||
'poskod' => $request->poskod,
|
||||
'koddaerah' => $poskod['koddaerah'],
|
||||
'kodnegeri' => $poskod['kodnegeri'],
|
||||
'kodkerja'=>$request->kodkerja,
|
||||
'nota_pekerjaan'=>$request->nota_pekerjaan,
|
||||
'telefon' => $request->telefon1,
|
||||
'telefon2' => $request->telefon2
|
||||
));
|
||||
@@ -377,7 +380,7 @@ class CustomerController extends Controller
|
||||
$poskod = Poskod::on('mysql7')->where('poskod','=',$request->poskod)->first();
|
||||
|
||||
$customer_info = DB::connection('mysql7')->table('customer')
|
||||
->select('kodcaw','tarikhdaftar','nopelanggan','kpbaru','kplama','nama','t_lahir','jantina','alamat1','poskod','telefon','telefon2')
|
||||
->select('kodcaw','kodkerja','nota_pekerjaan','tarikhdaftar','nopelanggan','kpbaru','kplama','nama','t_lahir','jantina','alamat1','poskod','telefon','telefon2')
|
||||
->where('kplama','=',$nokp)
|
||||
->orWhere('kpbaru','=',$nokp)
|
||||
->get()->toArray();
|
||||
@@ -392,6 +395,9 @@ class CustomerController extends Controller
|
||||
'telefon' => $request->telefon1,
|
||||
'telefon2' => $request->telefon2,
|
||||
'kodbank' => $request->kodbank,
|
||||
'kodkerja' => $request->kodkerja,
|
||||
// 'nota_pekerjaan' => $request->nota_pekerjaan,
|
||||
'nota_pekerjaan' => $request->kodkerja === '6' ? $request->nota_pekerjaan : null,
|
||||
'noakaun' => $request->noakaun,
|
||||
'nota' => $request->nota,
|
||||
'alamat1' => $request->alamat,
|
||||
@@ -403,7 +409,7 @@ class CustomerController extends Controller
|
||||
if($customer_update)
|
||||
{
|
||||
$customer_info_new = DB::connection('mysql7')->table('customer')
|
||||
->select('kodcaw','tarikhdaftar','nopelanggan','kpbaru','kplama','nama','t_lahir','jantina','alamat1','poskod','telefon','telefon2')
|
||||
->select('kodcaw','kodkerja','nota_pekerjaan','tarikhdaftar','nopelanggan','kpbaru','kplama','nama','t_lahir','jantina','alamat1','poskod','telefon','telefon2')
|
||||
->where('kplama','=',$nokp)
|
||||
->orWhere('kpbaru','=',$nokp)
|
||||
->get()->toArray();
|
||||
@@ -458,6 +464,8 @@ class CustomerController extends Controller
|
||||
'telefon' => $request->telefon1,
|
||||
'telefon2' => $request->telefon2,
|
||||
'kodbank' => $request->kodbank,
|
||||
'kodkerja' => $request->kodkerja,
|
||||
'nota_pekerjaan' => $request->nota_pekerjaan,
|
||||
'noakaun' => $request->noakaun,
|
||||
'nota' => $request->nota,
|
||||
'nama' => $request->nama,
|
||||
|
||||
@@ -12,4 +12,4 @@ class PekerjaanController extends Controller
|
||||
|
||||
return response()->json($kerja);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddNotaPekerjaan extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public function getActiveDB(){
|
||||
$config_db = array_keys(config("database.connections"));
|
||||
|
||||
$db_connection = array_filter($config_db,function($connection){
|
||||
try{
|
||||
if($connection == 'mysql7')
|
||||
return false;
|
||||
|
||||
$db = DB::connection($connection)->getPdo();
|
||||
return true;
|
||||
} catch(\Exception $e){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return $db_connection;
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
Schema::connection('mysql7')->table('customer', function (Blueprint $table) {
|
||||
$table->string('nota_pekerjaan')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('customer', function (Blueprint $table) {
|
||||
$table->dropColumn('nota_pekerjaan');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user