@@ -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);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\LogSession;
|
||||
use App\Cawangan;
|
||||
use App\Logsession as AppLogsession;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
class LogController extends Controller
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function logSession($kodcaw, Request $request)
|
||||
{
|
||||
// dd($request->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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Logsession extends Model
|
||||
{
|
||||
protected $table = 'logusers';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = ['nama','kodcaw','nokp','taraf','email'];
|
||||
|
||||
public $timestamps = true;
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
// protected $hidden = [];
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateLogusersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//return;
|
||||
|
||||
Schema::create('logusers', function (Blueprint $table) {
|
||||
$table->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');
|
||||
}
|
||||
}
|
||||
@@ -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']);
|
||||
|
||||
Reference in New Issue
Block a user