mirror of
https://github.com/Karaka-Management/oms-News.git
synced 2026-02-16 00:18:41 +00:00
reduce list loading
This commit is contained in:
parent
c6d7435307
commit
60dc80ecbd
|
|
@ -61,21 +61,21 @@ final class BackendController extends Controller implements DashboardElementInte
|
||||||
NewsArticleMapper::withConditional('language', $response->getLanguage())
|
NewsArticleMapper::withConditional('language', $response->getLanguage())
|
||||||
::withConditional('status', NewsStatus::VISIBLE, [NewsArticle::class])
|
::withConditional('status', NewsStatus::VISIBLE, [NewsArticle::class])
|
||||||
::withConditional('publish', new \DateTime('now'), [NewsArticle::class], '<=')
|
::withConditional('publish', new \DateTime('now'), [NewsArticle::class], '<=')
|
||||||
::getBeforePivot((int) ($request->getData('id') ?? 0), null, 25)
|
::getBeforePivot((int) ($request->getData('id') ?? 0), null, 10)
|
||||||
);
|
);
|
||||||
} elseif ($request->getData('ptype') === 'n') {
|
} elseif ($request->getData('ptype') === 'n') {
|
||||||
$view->setData('news',
|
$view->setData('news',
|
||||||
NewsArticleMapper::withConditional('language', $response->getLanguage())
|
NewsArticleMapper::withConditional('language', $response->getLanguage())
|
||||||
::withConditional('status', NewsStatus::VISIBLE, [NewsArticle::class])
|
::withConditional('status', NewsStatus::VISIBLE, [NewsArticle::class])
|
||||||
::withConditional('publish', new \DateTime('now'), [NewsArticle::class], '<=')
|
::withConditional('publish', new \DateTime('now'), [NewsArticle::class], '<=')
|
||||||
::getAfterPivot((int) ($request->getData('id') ?? 0), null, 25)
|
::getAfterPivot((int) ($request->getData('id') ?? 0), null, 10)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$view->setData('news',
|
$view->setData('news',
|
||||||
NewsArticleMapper::withConditional('language', $response->getLanguage())
|
NewsArticleMapper::withConditional('language', $response->getLanguage())
|
||||||
::withConditional('status', NewsStatus::VISIBLE, [NewsArticle::class])
|
::withConditional('status', NewsStatus::VISIBLE, [NewsArticle::class])
|
||||||
::withConditional('publish', new \DateTime('now'), [NewsArticle::class], '<=')
|
::withConditional('publish', new \DateTime('now'), [NewsArticle::class], '<=')
|
||||||
::getAfterPivot(0, null, 25)
|
::getAfterPivot(0, null, 10)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user