Merged in bugfix/fix-job (pull request #246)

fix kerja
This commit is contained in:
Ain Izazi Aziz
2025-01-02 04:21:48 +00:00
committed by Muhd hafifie
5 changed files with 65 additions and 4 deletions
+3 -1
View File
@@ -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',
];
}
}
+1
View File
@@ -60,6 +60,7 @@ class Customer extends Model
'tagperingatan',
'kumpulan',
'telefon2',
'nota_pekerjaan',
'tagpelanggan'
];
+10 -2
View File
@@ -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,
+1 -1
View File
@@ -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');
});
}
}