fix some bugs from accounting 9
This commit is contained in:
@@ -46,18 +46,23 @@ class CustomerAppNotifyService
|
||||
}
|
||||
|
||||
try {
|
||||
$row = DB::transaction(function () use ($customerId, $title, $body, $severity) {
|
||||
$row = AppNotification::create([
|
||||
'title' => $title,
|
||||
'body' => $body,
|
||||
'severity' => $severity,
|
||||
'is_active' => true,
|
||||
'created_by' => null,
|
||||
'audience_type' => AppNotificationAudienceService::TYPE_CUSTOMERS,
|
||||
'segment_keys' => null,
|
||||
'audience_label' => 'سیستمی — مشتری '.$customerId,
|
||||
'recipients_count' => 1,
|
||||
]);
|
||||
$payload = [
|
||||
'title' => $title,
|
||||
'body' => $body,
|
||||
'severity' => $severity,
|
||||
'is_active' => true,
|
||||
'created_by' => null,
|
||||
'audience_type' => AppNotificationAudienceService::TYPE_CUSTOMERS,
|
||||
'segment_keys' => null,
|
||||
'audience_label' => 'سیستمی — مشتری '.$customerId,
|
||||
'recipients_count' => 1,
|
||||
];
|
||||
if (\Illuminate\Support\Facades\Schema::hasColumn('app_notifications', 'is_system')) {
|
||||
$payload['is_system'] = true;
|
||||
}
|
||||
|
||||
$row = DB::transaction(function () use ($customerId, $payload) {
|
||||
$row = AppNotification::create($payload);
|
||||
|
||||
AppNotificationRecipient::query()->insert([
|
||||
'notification_id' => $row->id,
|
||||
|
||||
Reference in New Issue
Block a user