This commit is contained in:
2025-09-25 03:41:13 +05:00
parent ae480cf2f6
commit 14312dc5f9

View File

@@ -75,38 +75,38 @@ class SendOrderCreatedNotification implements ShouldQueue
*/ */
public function sendSMSToStaff($order): void public function sendSMSToStaff($order): void
{ {
$exists = DB::table('order_sent_notifications') // $exists = DB::table('order_sent_notifications')
->where('order_id', $order->id) // ->where('order_id', $order->id)
->where('phone_number', orderAdminNumber()) // ->where('phone_number', orderAdminNumber())
->exists(); // ->exists();
if (! $exists) { // if (! $exists) {
DB::table('order_sent_notifications') // DB::table('order_sent_notifications')
->insert([ // ->insert([
'order_id' => $order->id, // 'order_id' => $order->id,
'phone_number' => orderAdminNumber(), // 'phone_number' => orderAdminNumber(),
]); // ]);
sendSMS( // sendSMS(
phone: orderAdminNumber(), // phone: orderAdminNumber(),
message: sprintf( // message: sprintf(
'Täze sargyt: %s, eltip bermek: %s', // 'Täze sargyt: %s, eltip bermek: %s',
$order->id, // $order->id,
$order->shipping_method // $order->shipping_method
) // )
); // );
Log::channel('order_sms_notification_sent_activity') // Log::channel('order_sms_notification_sent_activity')
->info(sprintf('SMS_SENT_FOR_ORDER[id, phone]: %s, %s', $order->id, orderAdminNumber())); // ->info(sprintf('SMS_SENT_FOR_ORDER[id, phone]: %s, %s', $order->id, orderAdminNumber()));
User::where('phone_number', orderAdminNumber())->first()->notify( // User::where('phone_number', orderAdminNumber())->first()->notify(
NovaNotification::make() // NovaNotification::make()
->message('Täze sargyt.') // ->message('Täze sargyt.')
->action('Gör', sprintf('/turkmenpostadmin/resources/orders/%s', $order->id)) // ->action('Gör', sprintf('/turkmenpostadmin/resources/orders/%s', $order->id))
->icon('download') // ->icon('download')
->type('info') // ->type('info')
); // );
} // }
} }
/** /**