mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Merge pull request #217 from openclassify/dia
added a twig view function to get all advs [alibaba-theme]
This commit is contained in:
commit
32681ddc90
@ -52,6 +52,22 @@ class AdvCriteria extends EntryCriteria
|
||||
return $ads;
|
||||
}
|
||||
|
||||
public function allAdvs()
|
||||
{
|
||||
$advModel = new AdvModel();
|
||||
$latest_advs = AdvModel::query()
|
||||
->whereDate('finish_at', '>=', date("Y-m-d H:i:s"))
|
||||
->where('status', '=', 'approved')
|
||||
->where('slug', '!=', '')
|
||||
->paginate($this->settings->value('visiosoft.theme.base::s-type-latest-limit'));
|
||||
|
||||
$ads = $advModel->getLocationNames($latest_advs);
|
||||
foreach ($ads as $index => $ad) {
|
||||
$ads[$index]->detail_url = $advModel->getAdvDetailLinkByModel($ad, 'list');
|
||||
$ads[$index] = $advModel->AddAdsDefaultCoverImage($ad);
|
||||
}
|
||||
return $ads;
|
||||
}
|
||||
|
||||
public function getCurrentLocale()
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user