Merge branch 'ujrah_master' of https://bitbucket.org/arrahn-pkb/api_arrahn into finadev
This commit is contained in:
@@ -50,22 +50,22 @@ class SMSPelangganSAGLAMAbysag extends Job
|
||||
$mobile_no = ltrim($this->telefon, '+6');
|
||||
// $mobile_no = '60178916936';
|
||||
// $message = 'test';
|
||||
$tarikhmatang = date('d-m-Y',strtotime($this->tmatang));
|
||||
$tarikhmatang = date('d-m-Y',strtotime($this->tmatang));
|
||||
$tarikhmatang1 = date('d-m-Y',strtotime($this->tmatang1));
|
||||
$date = $current->toDateString();
|
||||
$today = date('d-m-Y',strtotime($date));
|
||||
// $current_date = new Carbon($current->toDateString());
|
||||
$tarikhmatang = $this->tmatang;
|
||||
$tarikhmatangnew = date('d-m-Y',strtotime($tarikhmatang));
|
||||
$tarikhmatang1 = $this->tmatang1;
|
||||
$tarikhmatang1new = date('d-m-Y',strtotime($tarikhmatang1));
|
||||
$today = $current->toDateString();
|
||||
// $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 '.$tarikhmatang.'.';
|
||||
$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.'.';
|
||||
}elseif($tarikhmatang < $today){
|
||||
$message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah tamat tempoh pada '.$tarikhmatang.', Sila perbaharui SAG anda di cawangan Ar-Rahn.';}
|
||||
$message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah tamat tempoh pada '.$tarikhmatangnew.', Sila perbaharui SAG anda 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 '.$tarikhmatang1.'.';
|
||||
$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.'.';
|
||||
}elseif($tarikhmatang1 > $today){
|
||||
$message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah tamat tempoh pada '.$tarikhmatang1.', Sila perbaharui SAG anda di cawangan Ar-Rahn.';}
|
||||
$message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah tamat tempoh pada '.$tarikhmatang1new.', Sila perbaharui SAG anda di cawangan Ar-Rahn.';}
|
||||
|
||||
if(env('APP_ENV') != 'production'){
|
||||
$mobile_no = env('ADMIN_PHONE_NUMBER');
|
||||
|
||||
@@ -51,21 +51,21 @@ class WhatsappPelangganSAGLAMAbysag extends Job
|
||||
$current = new Carbon();
|
||||
$mobile_no = ltrim($this->telefon, '+6');
|
||||
// $mobile_no = '60178916936';
|
||||
$tarikhmatang = date('d-m-Y',strtotime($this->tmatang));
|
||||
$tarikhmatang1 = date('d-m-Y',strtotime($this->tmatang1));
|
||||
$date = $current->toDateString();
|
||||
$today = date('d-m-Y',strtotime($date));
|
||||
// $current_date = new Carbon($current->toDateString());
|
||||
if($this->lelong_tawarruq == '1'){
|
||||
$tarikhmatang = $this->tmatang;
|
||||
$tarikhmatangnew = date('d-m-Y',strtotime($tarikhmatang));
|
||||
$tarikhmatang1 = $this->tmatang1;
|
||||
$tarikhmatang1new = date('d-m-Y',strtotime($tarikhmatang1));
|
||||
$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 *'.$tarikhmatang.'*.';
|
||||
$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.'*.';
|
||||
}elseif($tarikhmatang < $today){
|
||||
$message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah tamat tempoh pada *'.$tarikhmatang.'*, Sila perbaharui SAG anda di cawangan Ar-Rahn.';}
|
||||
$message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah tamat tempoh pada *'.$tarikhmatangnew.'*, Sila perbaharui SAG anda 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 *'.$tarikhmatang1.'*.';
|
||||
$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.'*.';
|
||||
}elseif($tarikhmatang1 > $today){
|
||||
$message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah tamat tempoh pada *'.$tarikhmatang1.'*, Sila perbaharui SAG anda di cawangan Ar-Rahn.';}
|
||||
$message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah tamat tempoh pada *'.$tarikhmatang1new.'*, Sila perbaharui SAG anda di cawangan Ar-Rahn.';}
|
||||
|
||||
if(env('APP_ENV') != 'production'){
|
||||
$mobile_no = env('ADMIN_PHONE_NUMBER');
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddColumnUjrahStokauditbackdate extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @var object $db_connection
|
||||
*/
|
||||
|
||||
|
||||
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()
|
||||
{
|
||||
$db_connection = $this->getActiveDB();
|
||||
|
||||
foreach($db_connection as $dbase){
|
||||
Schema::connection($dbase)->table('stokaudit1', function (Blueprint $table){
|
||||
$table->decimal('utgonepercent', 9, 2);
|
||||
$table->decimal('ujrah', 9, 2);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit2', function (Blueprint $table){
|
||||
$table->decimal('utgonepercent', 9, 2);
|
||||
$table->decimal('ujrah', 9, 2);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit3', function (Blueprint $table){
|
||||
$table->decimal('utgonepercent', 9, 2);
|
||||
$table->decimal('ujrah', 9, 2);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit4', function (Blueprint $table){
|
||||
$table->decimal('utgonepercent', 9, 2);
|
||||
$table->decimal('ujrah', 9, 2);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit5', function (Blueprint $table){
|
||||
|
||||
$table->decimal('utgonepercent', 9, 2);
|
||||
$table->decimal('ujrah', 9, 2);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit6', function (Blueprint $table){
|
||||
|
||||
$table->decimal('utgonepercent', 9, 2);
|
||||
$table->decimal('ujrah', 9, 2);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit7', function (Blueprint $table){
|
||||
|
||||
$table->decimal('utgonepercent', 9, 2);
|
||||
$table->decimal('ujrah', 9, 2);
|
||||
|
||||
});
|
||||
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit8', function (Blueprint $table){
|
||||
|
||||
$table->decimal('utgonepercent', 9, 2);
|
||||
$table->decimal('ujrah', 9, 2);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit9', function (Blueprint $table){
|
||||
|
||||
$table->decimal('utgonepercent', 9, 2);
|
||||
$table->decimal('ujrah', 9, 2);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit10', function (Blueprint $table){
|
||||
|
||||
$table->decimal('utgonepercent', 9, 2);
|
||||
$table->decimal('ujrah', 9, 2);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit11', function (Blueprint $table){
|
||||
|
||||
$table->decimal('utgonepercent', 9, 2);
|
||||
$table->decimal('ujrah', 9, 2);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit12', function (Blueprint $table){
|
||||
|
||||
$table->decimal('utgonepercent', 9, 2);
|
||||
$table->decimal('ujrah', 9, 2);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$db_connection = $this->getActiveDB();
|
||||
|
||||
foreach($db_connection as $dbase){
|
||||
Schema::connection($dbase)->table('stokaudit1', function (Blueprint $table) {
|
||||
$table->dropColumn(['utgonepercent', 'ujrah']);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit2', function (Blueprint $table) {
|
||||
$table->dropColumn(['utgonepercent', 'ujrah']);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit3', function (Blueprint $table) {
|
||||
$table->dropColumn(['utgonepercent', 'ujrah']);
|
||||
});
|
||||
Schema::connection($dbase)->table('stokaudit4', function (Blueprint $table) {
|
||||
$table->dropColumn(['utgonepercent', 'ujrah']);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit5', function (Blueprint $table) {
|
||||
$table->dropColumn(['utgonepercent', 'ujrah']);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit6', function (Blueprint $table) {
|
||||
$table->dropColumn(['utgonepercent', 'ujrah']);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit7', function (Blueprint $table) {
|
||||
$table->dropColumn(['utgonepercent', 'ujrah']);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit8', function (Blueprint $table) {
|
||||
$table->dropColumn(['utgonepercent', 'ujrah']);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit9', function (Blueprint $table) {
|
||||
$table->dropColumn(['utgonepercent', 'ujrah']);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit10', function (Blueprint $table) {
|
||||
$table->dropColumn(['utgonepercent', 'ujrah']);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit11', function (Blueprint $table) {
|
||||
$table->dropColumn(['utgonepercent', 'ujrah']);
|
||||
});
|
||||
|
||||
Schema::connection($dbase)->table('stokaudit12', function (Blueprint $table) {
|
||||
$table->dropColumn(['utgonepercent', 'ujrah']);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user