fix some bugs
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user