fix some bugs

This commit is contained in:
2026-07-29 17:00:51 +03:30
parent dd77e2ce81
commit 16b947adc5
6 changed files with 138 additions and 44 deletions
@@ -309,6 +309,7 @@ class AppNotificationController extends Controller
];
$stream = app(PriceStreamService::class);
$unread = app(\App\Services\AppNotificationUnreadService::class);
if ($row->audience_type === AppNotificationAudienceService::TYPE_ALL) {
$stream->publish('app_notification', $payload);
@@ -321,7 +322,11 @@ class AppNotificationController extends Controller
->pluck('customer_id');
foreach ($ids as $customerId) {
$stream->publishForCustomer((int) $customerId, 'app_notification', $payload);
$cid = (int) $customerId;
$stream->publishForCustomer($cid, 'app_notification', array_merge($payload, [
'unread_count' => $unread->countForCustomer($cid),
]));
$unread->publishForCustomer($cid);
}
}
}