add commits from server 25/9/2023
This commit is contained in:
+20
-2
@@ -8,15 +8,33 @@ class Blacklist extends Model
|
|||||||
{
|
{
|
||||||
protected $table = 'senhitam';
|
protected $table = 'senhitam';
|
||||||
protected $connection = 'mysql7';
|
protected $connection = 'mysql7';
|
||||||
|
public $timestamps = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* The attributes that are mass assignable.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
// protected $fillable = [
|
|
||||||
|
|
||||||
// ];
|
protected $fillable = [
|
||||||
|
'nosiri',
|
||||||
|
'kodcaw',
|
||||||
|
'tarikhdaftar',
|
||||||
|
'kplama',
|
||||||
|
'kpbaru',
|
||||||
|
'nokp',
|
||||||
|
'nama',
|
||||||
|
't_lahir',
|
||||||
|
'jantina',
|
||||||
|
'alamat1',
|
||||||
|
'alamat2',
|
||||||
|
'alamat3',
|
||||||
|
'alamat4',
|
||||||
|
'telefon',
|
||||||
|
'nota',
|
||||||
|
'teller',
|
||||||
|
'pelulus',
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes excluded from the model's JSON form.
|
* The attributes excluded from the model's JSON form.
|
||||||
|
|||||||
@@ -1656,6 +1656,7 @@ class AdminPageController extends Controller
|
|||||||
->first();
|
->first();
|
||||||
|
|
||||||
$blacklist = Blacklist::on('mysql7')->create([
|
$blacklist = Blacklist::on('mysql7')->create([
|
||||||
|
'nosiri' => $customer['nosiri'],
|
||||||
'kodcaw' => $customer['kodcaw'],
|
'kodcaw' => $customer['kodcaw'],
|
||||||
'tarikhdaftar' => $customer['tarikhdaftar'],
|
'tarikhdaftar' => $customer['tarikhdaftar'],
|
||||||
'kplama' => $customer['kplama'],
|
'kplama' => $customer['kplama'],
|
||||||
|
|||||||
@@ -785,7 +785,7 @@ class LaporanController extends Controller
|
|||||||
|
|
||||||
$tebus = Tebus::on($cawangan['mysql'])
|
$tebus = Tebus::on($cawangan['mysql'])
|
||||||
->join('gadai as gad','gad.norujukan','=','tebus.norujukan')
|
->join('gadai as gad','gad.norujukan','=','tebus.norujukan')
|
||||||
->where([['t_tebus','>=',$request->mula],['t_tebus','<=',$request->akhir]]);
|
->where([['t_tebus','>=',$request->mula],['t_tebus','<=',$request->akhir],['jenistebus','=','T']]);
|
||||||
|
|
||||||
$ansuran = Transaction::on('mysql7')->whereDate('created_at','>=',$request->mula)->whereDate('created_at','<=',$request->akhir)->where([['trans_type','=','A'],['kodcaw','=',$request->kodcaw]]);
|
$ansuran = Transaction::on('mysql7')->whereDate('created_at','>=',$request->mula)->whereDate('created_at','<=',$request->akhir)->where([['trans_type','=','A'],['kodcaw','=',$request->kodcaw]]);
|
||||||
$bayaranonlinequery = Transaction::on('mysql7')->whereDate('created_at','>=',$request->mula)->whereDate('created_at','<=',$request->akhir)->where('teller','=','Online')->where('kodcaw',$request->kodcaw);
|
$bayaranonlinequery = Transaction::on('mysql7')->whereDate('created_at','>=',$request->mula)->whereDate('created_at','<=',$request->akhir)->where('teller','=','Online')->where('kodcaw',$request->kodcaw);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class PoskodController extends Controller
|
|||||||
return response()->json($e, 403);
|
return response()->json($e, 403);
|
||||||
}
|
}
|
||||||
|
|
||||||
$created_poskod = Poskod::create([
|
$created_poskod = Poskod::on('mysql7')->create([
|
||||||
'poskod' => $validated['poskod'],
|
'poskod' => $validated['poskod'],
|
||||||
'koddaerah' => $validated['koddaerah'],
|
'koddaerah' => $validated['koddaerah'],
|
||||||
'kodnegeri' => $validated['kodnegeri'],
|
'kodnegeri' => $validated['kodnegeri'],
|
||||||
@@ -67,7 +67,7 @@ class PoskodController extends Controller
|
|||||||
|
|
||||||
public function update(Request $request)
|
public function update(Request $request)
|
||||||
{
|
{
|
||||||
$poskod = Poskod::find($request->recno);
|
$poskod = Poskod::on('mysql7')->find($request->recno);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$validated = $this->validate($request, [
|
$validated = $this->validate($request, [
|
||||||
|
|||||||
@@ -246,9 +246,21 @@ class TransactionOnlineController extends Controller
|
|||||||
|
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
|
$boolmasa = false;
|
||||||
$transaction_online = TransactionOnline::on('mysql7')->where([['norujukan',$request->norujukan],['status','PAID'],['update_status',0],['tarikh',$current->toDateString()]])->first();
|
$transaction_online = TransactionOnline::on('mysql7')->where([['norujukan',$request->norujukan],['status','PAID'],['update_status',0],['tarikh',$current->toDateString()]])->first();
|
||||||
if($transaction_online){
|
|
||||||
|
$transaction_masa = TransactionOnline::on('mysql7')->where([['norujukan',$request->norujukan],['status','NOT PAID'],['tarikh',$current->toDateString()]])
|
||||||
|
->orderBy('masa', 'desc')->first();
|
||||||
|
|
||||||
|
if($transaction_masa){
|
||||||
|
$carbonmasa = new Carbon($transaction_masa['masa']);
|
||||||
|
$carbonmasaexpired = new Carbon($transaction_masa['masa']);
|
||||||
|
$carbonmasaexpired->addMinutes(10);
|
||||||
|
|
||||||
|
$boolmasa = ($carbonmasaexpired->greaterThanOrEqualTo($current) && $carbonmasa->lessThanOrEqualTo($current)) ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($transaction_online || $boolmasa){
|
||||||
return response()->json(true);
|
return response()->json(true);
|
||||||
}else{
|
}else{
|
||||||
return response()->json(false);
|
return response()->json(false);
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddColumnsToKomuditiTransaksi extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::connection($this->getOnlineArrahnConnection())->table('komuditi_transaksi', function (Blueprint $table){
|
||||||
|
$table->string('customer_id', 10, 2)->after('nosijil');
|
||||||
|
$table->float('harga', 10, 2)->after('nosijil');
|
||||||
|
$table->float('tan', 10, 2)->after('nosijil');
|
||||||
|
$table->string('no_sijil_pelanggan')->after('nosijil')->comment('format: no sijil bursa + no siri PKB');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::connection($this->getOnlineArrahConnection())->table('komuditi_transaksi', function (Blueprint $table){
|
||||||
|
$table->dropColumn('no_sijil_pelanggan');
|
||||||
|
$table->dropColumn('tan');
|
||||||
|
$table->dropColumn('harga');
|
||||||
|
$table->dropColumn('customer_id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getOnlineArrahnConnection()
|
||||||
|
{
|
||||||
|
$online_arrahn_connection_array = array_filter(config('database.connections'), function($connection) {
|
||||||
|
|
||||||
|
if($connection['database'] === 'online_arrahn'){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
if(empty($online_arrahn_connection_array)){
|
||||||
|
throw new Exception("online_arrahn doesn't exist in config.database.connections array");
|
||||||
|
}
|
||||||
|
|
||||||
|
return array_keys($online_arrahn_connection_array)[0];
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user