diff --git a/app/Http/Controllers/CustomerController.php b/app/Http/Controllers/CustomerController.php index c6d66f1..30acf84 100644 --- a/app/Http/Controllers/CustomerController.php +++ b/app/Http/Controllers/CustomerController.php @@ -12,6 +12,7 @@ use App\Poskod; use App\Blacklist; use App\AuditCustomer; use Illuminate\Http\Request; +use App\TuntutBaki; use Carbon\Carbon; @@ -155,6 +156,12 @@ class CustomerController extends Controller ->where([['sttebus','=',$gadai_status],['nokp','=',$ic]]) ->rightJoin('lelong', 'gadai.norujukan', '=', 'lelong.norujukan') ->get(); + if($gadai[0]['trkhtuntut'] != NULL){ + $tuntutbaki = TuntutBaki::on($cawangan['mysql']) + ->where('norujukan','=',$gadai[0]['norujukan']) + ->first(); + $gadai[0]['datatuntut'] = $tuntutbaki; + } } return response()->json($gadai); } diff --git a/app/Http/Controllers/LogController.php b/app/Http/Controllers/LogController.php new file mode 100644 index 0000000..6af7955 --- /dev/null +++ b/app/Http/Controllers/LogController.php @@ -0,0 +1,59 @@ +all()); + + $logsession = Logsession::on('mysql7')->where('kodcaw', '=', $kodcaw) + ->create([ + 'nama' => $request->nama, + 'nokp' => $request->nokp, + 'kodcaw' => $request->kodcaw, + 'email' => $request->email, + 'taraf' => $request->taraf, + + ]); + + + return response()->json($logsession); + } + + public function checkNokpSession($kodcaw, $nokp, $tarikh) + { + + $cawangan = Cawangan::on('mysql7')->where('kodcaw', '=', $kodcaw)->first(); + + $checknokp = Logsession::on('mysql7')->where('kodcaw', '=', $kodcaw) + ->where('nokp', '=', $nokp) + ->where('created_at','LIKE',"%{$tarikh}%") + ->get(); + + if (sizeof($checknokp) != 0) { + $newnokp = $nokp; + } else { + + $newnokp = 'NULL'; + } + return response()->json($newnokp); + } + + +} diff --git a/app/Http/Controllers/PanjarController.php b/app/Http/Controllers/PanjarController.php index e6c5374..843505a 100644 --- a/app/Http/Controllers/PanjarController.php +++ b/app/Http/Controllers/PanjarController.php @@ -64,6 +64,8 @@ class PanjarController extends Controller ->where('tarikh','>=',$mula) ->where('tarikh','<=',$akhir) ->orderBy('tarikh','desc') + ->orderBy('nobaucer','desc') + ->get(); return response()->json($panjar); diff --git a/app/Jobs/ARCCSMSPelangganSAGLAMAbysag.php b/app/Jobs/ARCCSMSPelangganSAGLAMAbysag.php index e3270da..5744100 100644 --- a/app/Jobs/ARCCSMSPelangganSAGLAMAbysag.php +++ b/app/Jobs/ARCCSMSPelangganSAGLAMAbysag.php @@ -62,14 +62,14 @@ class ARCCSMSPelangganSAGLAMAbysag extends Job // $current_date = new Carbon($current->toDateString()); if($this->lelong_tawarruq == '1'){ if($tarikhmatang > $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah hampir tamat tempoh untuk tukar ke SAG baru, Sila perbaharui SAG anda di cawangan sebelum '.$tarikhmatangnew.'.'; + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah hampir tamat tempoh matang, Sila buat pembayaran di cawangan sebelum '.$tarikhmatangnew.'.'; }elseif($tarikhmatang < $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah tamat tempoh pada '.$tarikhmatangnew.', Sila perbaharui SAG anda di cawangan Ar-Rahn.';} + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah tamat tempoh matang pada '.$tarikhmatangnew.', Sila buat pembayaran di cawangan AR-RAHN.';} }else if($tarikhmatang1 > $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah hampir tamat tempoh untuk tukar ke SAG baru, Sila perbaharui SAG anda di cawangan sebelum '.$tarikhmatang1new.'.'; + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah hampir tamat tempoh kontrak, Sila buat pembayaran di cawangan sebelum '.$tarikhmatang1new.'.'; }elseif($tarikhmatang1 <= $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah tamat tempoh pada '.$tarikhmatang1new.', Sila perbaharui SAG anda di cawangan Ar-Rahn.';} + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah tamat tempoh kontrak pada '.$tarikhmatang1new.', Sila buat pembayaran di cawangan AR-RAHN.';} if(env('APP_ENV') != 'production'){ $mobile_no = env('ADMIN_PHONE_NUMBER'); diff --git a/app/Jobs/ARCCWhatsappPelangganSAGLAMAbysag.php b/app/Jobs/ARCCWhatsappPelangganSAGLAMAbysag.php index e4e7668..c577cbd 100644 --- a/app/Jobs/ARCCWhatsappPelangganSAGLAMAbysag.php +++ b/app/Jobs/ARCCWhatsappPelangganSAGLAMAbysag.php @@ -62,14 +62,14 @@ class ARCCWhatsappPelangganSAGLAMAbysag extends Job $today = $current->toDateString(); if($this->lelong_tawarruq == '1'){ if($tarikhmatang > $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah hampir tamat tempoh untuk tukar ke SAG baru, Sila perbaharui SAG anda di cawangan sebelum *'.$tarikhmatangnew.'*.'; + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah hampir tamat tempoh matang, Sila buat pembayaran di cawangan sebelum *'.$tarikhmatangnew.'*.'; }elseif($tarikhmatang <= $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah tamat tempoh pada *'.$tarikhmatangnew.'*, Sila perbaharui SAG anda di cawangan AR-RAHN.';} + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah tamat tempoh matang pada *'.$tarikhmatangnew.'*, Sila buat pembayaran di cawangan AR-RAHN.';} }else if($tarikhmatang1 > $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah hampir tamat tempoh untuk tukar ke SAG baru, Sila perbaharui SAG anda di cawangan sebelum *'.$tarikhmatang1new.'*.'; + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah hampir tamat tempoh kontrak, Sila buat pembayaran di cawangan sebelum *'.$tarikhmatang1new.'*.'; }elseif($tarikhmatang1 <= $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah tamat tempoh pada *'.$tarikhmatang1new.'*, Sila perbaharui SAG anda di cawangan Ar-Rahn.';} + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah tamat tempoh kontrak pada *'.$tarikhmatang1new.'*, Sila buat pembayaran di cawangan Ar-Rahn.';} if(env('APP_ENV') != 'production'){ $mobile_no = env('ADMIN_PHONE_NUMBER'); diff --git a/app/Jobs/SMSPelangganSAGLAMAbysag.php b/app/Jobs/SMSPelangganSAGLAMAbysag.php index c23681a..de81e8b 100644 --- a/app/Jobs/SMSPelangganSAGLAMAbysag.php +++ b/app/Jobs/SMSPelangganSAGLAMAbysag.php @@ -58,14 +58,14 @@ class SMSPelangganSAGLAMAbysag extends Job // $current_date = new Carbon($current->toDateString()); if($this->lelong_tawarruq == '1'){ if($tarikhmatang > $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah hampir tamat tempoh untuk tukar ke SAG baru, Sila perbaharui SAG anda di cawangan sebelum '.$tarikhmatangnew.'.'; + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah hampir tamat tempoh matang, Sila buat pembayaran di cawangan sebelum '.$tarikhmatangnew.'.'; }elseif($tarikhmatang < $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah tamat tempoh pada '.$tarikhmatangnew.', Sila perbaharui SAG anda di cawangan Ar-Rahn.';} + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah tamat tempoh matang pada '.$tarikhmatangnew.', Sila buat pembayaran di cawangan AR-RAHN.';} }else if($tarikhmatang1 < $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah hampir tamat tempoh untuk tukar ke SAG baru, Sila perbaharui SAG anda di cawangan sebelum '.$tarikhmatang1new.'.'; + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah hampir tamat tempoh kontrak, Sila buat pembayaran di cawangan sebelum '.$tarikhmatang1new.'.'; }elseif($tarikhmatang1 > $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah tamat tempoh pada '.$tarikhmatang1new.', Sila perbaharui SAG anda di cawangan Ar-Rahn.';} + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah tamat tempoh kontrak pada '.$tarikhmatang1new.', Sila buat pembayaran di cawangan AR-RAHN.';} if(env('APP_ENV') != 'production'){ $mobile_no = env('ADMIN_PHONE_NUMBER'); diff --git a/app/Jobs/WhatsappPelangganSAGLAMAbysag.php b/app/Jobs/WhatsappPelangganSAGLAMAbysag.php index 2d03e59..93cc8d7 100644 --- a/app/Jobs/WhatsappPelangganSAGLAMAbysag.php +++ b/app/Jobs/WhatsappPelangganSAGLAMAbysag.php @@ -58,14 +58,14 @@ class WhatsappPelangganSAGLAMAbysag extends Job $today = $current->toDateString(); if($this->lelong_tawarruq == '1'){ if($tarikhmatang > $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah hampir tamat tempoh untuk tukar ke SAG baru, Sila perbaharui SAG anda di cawangan sebelum *'.$tarikhmatangnew.'*.'; + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah hampir tamat tempoh matang, Sila buat pembayaran di cawangan sebelum *'.$tarikhmatangnew.'*.'; }elseif($tarikhmatang < $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah tamat tempoh pada *'.$tarikhmatangnew.'*, Sila perbaharui SAG anda di cawangan Ar-Rahn.';} + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah tamat tempoh matang pada *'.$tarikhmatangnew.'*, Sila buat pembayaran di cawangan AR-RAHN.';} }else if($tarikhmatang1 < $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah hampir tamat tempoh untuk tukar ke SAG baru, Sila perbaharui SAG anda di cawangan sebelum *'.$tarikhmatang1new.'*.'; + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah hampir tamat tempoh kontrak, Sila buat pembayaran di cawangan sebelum *'.$tarikhmatang1new.'*.'; }elseif($tarikhmatang1 > $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah tamat tempoh pada *'.$tarikhmatang1new.'*, Sila perbaharui SAG anda di cawangan Ar-Rahn.';} + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah tamat tempoh kontrak pada *'.$tarikhmatang1new.'*, Sila buat pembayaran di cawangan Ar-Rahn.';} if(env('APP_ENV') != 'production'){ $mobile_no = env('ADMIN_PHONE_NUMBER'); diff --git a/app/LogSession.php b/app/LogSession.php new file mode 100644 index 0000000..712b5cb --- /dev/null +++ b/app/LogSession.php @@ -0,0 +1,25 @@ +id(); + $table->string('kodcaw')->nullable(); + $table->string('nokp')->nullable(); + $table->string('taraf')->nullable(); + $table->string('nama')->nullable(); + $table->string('email')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('logusers'); + } +} diff --git a/routes/web.php b/routes/web.php index 01336d6..b85e395 100644 --- a/routes/web.php +++ b/routes/web.php @@ -104,6 +104,10 @@ $router->group(['prefix'=>'api'], function () use ($router){ $router->get('search/lelong',['uses'=>'LelongController@searchBlockLelong']); $router->get('hapus/gadai/null',['uses'=>'GadaiController@hapusGadaiNull']); + ///Log session + $router->post('logsession/{kodcaw}',['uses'=>'LogController@logSession']); + $router->get('checknokp/{kodcaw}/{nokp}/{tarikh}',['uses'=>'LogController@checkNokpSession']); + //Tebus API $router->get('tebustawarruq/{kodcaw}/{norujukan}',['uses'=>'TebusController@tebusTawarruq']); $router->get('upahtawarruq/{kodcaw}/{norujukan}',['uses'=>'TebusController@upahTawarruq']);