mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -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;
|
$this->image = $image;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getAdvsModel()
|
||||||
|
{
|
||||||
|
return new AdvModel();
|
||||||
|
}
|
||||||
|
|
||||||
public function popularAdvs()
|
public function popularAdvs()
|
||||||
{
|
{
|
||||||
$advModel = new AdvModel();
|
$advModel = new AdvModel();
|
||||||
@ -72,14 +77,14 @@ class AdvCriteria extends EntryCriteria
|
|||||||
return $ads;
|
return $ads;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function findAdsByCategoryId($catId)
|
public function findAdsByCategoryId($catId, $level = 1)
|
||||||
{
|
{
|
||||||
$advModel = new AdvModel();
|
$advModel = new AdvModel();
|
||||||
$advs = AdvModel::query()
|
$advs = AdvModel::query()
|
||||||
->whereDate('finish_at', '>=', date("Y-m-d H:i:s"))
|
->whereDate('finish_at', '>=', date("Y-m-d H:i:s"))
|
||||||
->where('status', '=', 'approved')
|
->where('status', '=', 'approved')
|
||||||
->where('slug', '!=', '')
|
->where('slug', '!=', '')
|
||||||
->where('cat1', $catId)
|
->where('cat' . $level, $catId)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
$ads = $advModel->getLocationNames($advs);
|
$ads = $advModel->getLocationNames($advs);
|
||||||
|
|||||||
@ -40,6 +40,12 @@ class CatsModulePlugin extends Plugin
|
|||||||
$category_model = new CategoryModel();
|
$category_model = new CategoryModel();
|
||||||
return $category_model->getParentCats($id,'add_main');
|
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