Fix check commodity is sold or not
This commit is contained in:
@@ -37,7 +37,7 @@ class WhatsappUnsoldCommodityNotification extends Job
|
|||||||
$start_time = $settings->where('key', 'start_time')->first()->value;
|
$start_time = $settings->where('key', 'start_time')->first()->value;
|
||||||
$end_time = $settings->where('key', 'end_time')->first()->value;
|
$end_time = $settings->where('key', 'end_time')->first()->value;
|
||||||
$message = $settings->where('key', 'message')->first()->value;
|
$message = $settings->where('key', 'message')->first()->value;
|
||||||
$isKomoditiStillAvailable = KomuditiPurchase::on('mysql7')->latest()->first()->unit_komuditi === 0;
|
$isKomoditiStillSold = KomuditiPurchase::on('mysql7')->latest()->first()->unit_komuditi === 0;
|
||||||
|
|
||||||
$pic_key = 'pic_' . strtolower(Carbon::now()->englishDayOfWeek);
|
$pic_key = 'pic_' . strtolower(Carbon::now()->englishDayOfWeek);
|
||||||
$pic = json_decode($settings->where('key', $pic_key)->first()->value);
|
$pic = json_decode($settings->where('key', $pic_key)->first()->value);
|
||||||
@@ -65,7 +65,7 @@ class WhatsappUnsoldCommodityNotification extends Job
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$isKomoditiStillAvailable) {
|
if ($isKomoditiStillSold) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user