mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Merge pull request #575 from openclassify/dia
#1447 [arabam-theme] 3 pages improvments
This commit is contained in:
commit
97d4c7efbd
@ -19,6 +19,11 @@ class AdvCriteria extends EntryCriteria
|
||||
$this->image = $image;
|
||||
}
|
||||
|
||||
public function getAdvsModel()
|
||||
{
|
||||
return new AdvModel();
|
||||
}
|
||||
|
||||
public function popularAdvs()
|
||||
{
|
||||
$advModel = new AdvModel();
|
||||
@ -72,14 +77,14 @@ class AdvCriteria extends EntryCriteria
|
||||
return $ads;
|
||||
}
|
||||
|
||||
public function findAdsByCategoryId($catId)
|
||||
public function findAdsByCategoryId($catId, $level = 1)
|
||||
{
|
||||
$advModel = new AdvModel();
|
||||
$advs = AdvModel::query()
|
||||
->whereDate('finish_at', '>=', date("Y-m-d H:i:s"))
|
||||
->where('status', '=', 'approved')
|
||||
->where('slug', '!=', '')
|
||||
->where('cat1', $catId)
|
||||
->where('cat' . $level, $catId)
|
||||
->get();
|
||||
|
||||
$ads = $advModel->getLocationNames($advs);
|
||||
|
||||
@ -40,6 +40,12 @@ class CatsModulePlugin extends Plugin
|
||||
$category_model = new CategoryModel();
|
||||
return $category_model->getParentCats($id,'add_main');
|
||||
}
|
||||
), new \Twig_SimpleFunction(
|
||||
'getParentsCount',
|
||||
function ($id) {
|
||||
$category_model = new CategoryModel();
|
||||
return $category_model->getParentsCount($id);
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user