style updates
This commit is contained in:
+1
-1
@@ -49,7 +49,7 @@ return new class extends Migration
|
||||
'sort_order' => ($index + 1) * 10,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -74,7 +74,7 @@ return new class extends Migration
|
||||
Comment::query()->orderBy('id')->chunkById(100, static function ($comments): void {
|
||||
foreach ($comments as $comment) {
|
||||
$guid = $comment->guid ?: (string) Str::uuid();
|
||||
$unid = $comment->unid ?: strtoupper(hash('sha256', $guid.'|'.$comment->ticket_id.'|'.$comment->id));
|
||||
$unid = $comment->unid ?: strtoupper(hash('sha256', $guid . '|' . $comment->ticket_id . '|' . $comment->id));
|
||||
$parent = $comment->parent_id ? Comment::query()->find($comment->parent_id) : null;
|
||||
$parentUnid = $parent?->unid;
|
||||
$rootUnid = $parent?->root_unid ?: $parentUnid ?: $unid;
|
||||
@@ -86,7 +86,7 @@ return new class extends Migration
|
||||
'unid' => $unid,
|
||||
'parent_unid' => $parentUnid,
|
||||
'root_unid' => $rootUnid,
|
||||
'originator_id' => $comment->originator_id ?: $unid.':1',
|
||||
'originator_id' => $comment->originator_id ?: $unid . ':1',
|
||||
'sync_sequence' => $comment->sync_sequence ?: 1,
|
||||
'sync_hash' => hash('sha256', (string) $comment->body),
|
||||
'body_text' => trim(strip_tags((string) $comment->body)),
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ return new class extends Migration
|
||||
$plain = trim(preg_replace('/\s+/', ' ', strip_tags((string) ($comment->body_text ?: $comment->body))) ?: '');
|
||||
$subject = (bool) $comment->is_internal
|
||||
? 'Internal note'
|
||||
: ((int) ($comment->parent_id ?? 0) > 0 ? 'RE: ' : '').Str::limit($plain !== '' ? $plain : 'Response', 120, '');
|
||||
: ((int) ($comment->parent_id ?? 0) > 0 ? 'RE: ' : '') . Str::limit($plain !== '' ? $plain : 'Response', 120, '');
|
||||
|
||||
DB::table('helpdesk_comments')
|
||||
->where('id', $comment->id)
|
||||
|
||||
Reference in New Issue
Block a user