Update job for notis peringatan kedua

This commit is contained in:
Amir
2023-05-24 13:10:54 +08:00
parent 0a08a4bcd6
commit 7d99167ad8
2 changed files with 10 additions and 12 deletions
+2 -2
View File
@@ -27,7 +27,7 @@ use App\Models\TransaksiKeuntungan;
use App\Models\LelongTebus;
use App\Models\LogUser;
use Illuminate\Support\Facades\Log;
use App\Jobs\SendWabot;
use App\Jobs\WhatsappNotisPeringatanKedua;
use App\Models\FailedJob;
use Carbon\Carbon;
use PDF;
@@ -1681,7 +1681,7 @@ Sekian, terima kasih.';
$tarikh_cetak = $currentdate->toDateString();
$notis = Notis::find($notisid);
$this->dispatch(new SendWabot($notisid,$cawid));
WhatsappNotisPeringatanKedua::dispatch($user->id, $user->kodcaw, $notisid, $cawid);
$updatestatus = CawanganNotis::where('notis_id', '=', $notisid)->where('caw_id', '=', $cawid)->first();
$updatestatus->status = '3'; //blastwabot
@@ -20,10 +20,12 @@ use Illuminate\Support\Facades\Http;
use App\Models\CawanganNotis;
use Illuminate\Support\Facades\Artisan;
class SendWabot implements ShouldQueue
class WhatsappNotisPeringatanKedua implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $user_id;
protected $user_kodcaw;
protected $notisid;
protected $cawid;
@@ -32,8 +34,10 @@ class SendWabot implements ShouldQueue
*
* @return void
*/
public function __construct($notisid,$cawid)
public function __construct($user_id, $user_kodcaw, $notisid,$cawid)
{
$this->user_id = $user_id;
$this->user_kodcaw = $user_kodcaw;
$this->notisid = $notisid;
$this->cawid = $cawid;
}
@@ -152,8 +156,6 @@ Sekian, terima kasih.';
}
// dd($message);
// $message = 'Hello%20Nadine%0Ahow%20are%20you%0A';
$response = Http::get(env('WABOT_API'), [
'number' => $mobile_no,
'type' => 'text',
@@ -162,13 +164,9 @@ Sekian, terima kasih.';
'access_token' => env('WABOT_TOKEN_KEYS')
]);
Log::info($response);
Log::info("WABOT " . $response);
}
// dd($suratnotis['data_notisbid'][$index]);
sleep(2);
}
// $updatestatus = CawanganNotis::where('notis_id', '=', $this->notisid)->where('caw_id', '=', $this->cawid)->first();
// $updatestatus->status = '3'; //blastwabot
// $updatestatus->save();
}
}