Skip to content

Commit 128b696

Browse files
committed
カスタムエントリーの年別投稿一覧がデータ生成日ベースになっていたので投稿日ベースに変更
1 parent e389af2 commit 128b696

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

plugins/bc-custom-content/src/View/Helper/CustomContentHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ public function getYearList(Int $contentId)
485485
->first();
486486

487487
$records = $targetEntries->find()
488-
->select(['year' => 'YEAR(created)'])
488+
->select(['year' => 'YEAR(published)'])
489489
->distinct(['year'])
490490
->all()
491491
->toArray();

plugins/bc-custom-content/tests/Scenario/CustomEntriesScenario.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ public function load(...$args): mixed
3838
'id' => 2,
3939
'custom_table_id' => 1,
4040
'name' => 'プログラマー 2',
41+
'published' => '2025-01-30 07:09:22',
4142
])->persist();
4243
CustomEntryFactory::make([
4344
'id' => 3,
4445
'custom_table_id' => 1,
4546
'name' => 'プログラマー 3',
47+
'published' => '2025-01-30 07:09:22',
4648
])->persist();
4749
return null;
4850
}

0 commit comments

Comments
 (0)