Skip to content

Commit

Permalink
#326 게시물 리스트 위젯 - 카테고리 선택에서 게시판 하나만 설정한 경우 확장 필드도 같이 가져오도록 수정.
Browse files Browse the repository at this point in the history
  • Loading branch information
xharpenParksuhyeon committed Dec 20, 2021
1 parent a6530ae commit ad750a1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion components/Widgets/ArticleList/ArticleListWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

use Carbon\Carbon;
use View;
use XEHub\XePlugin\XehubCustomDevelop\Models\Certificate;
use Xpressengine\Category\Models\Category;
use Xpressengine\Category\Models\CategoryItem;
use Xpressengine\Menu\Models\MenuItem;
Expand Down Expand Up @@ -117,7 +118,13 @@ public function render()
});
});
} elseif (count($boardIds)) {
$query = $model->whereIn('instance_id', $boardIds);
$query = $model->newQuery();

if (count($boardIds) === 1) {
$query = Board::division($boardIds[0]);
}

$query->whereIn('instance_id', $boardIds);
} elseif (count($categoryIds)) {
$query = $model->whereHas('boardCategory', function ($query) use ($categoryIds) {
$query->whereIn('item_id', $categoryIds);
Expand Down

0 comments on commit ad750a1

Please sign in to comment.