|
|
@ -431,7 +431,7 @@ function showCatNested($cats, $parent = null)
|
|
|
|
$ret = "";
|
|
|
|
$ret = "";
|
|
|
|
foreach ($cats as $cat) {
|
|
|
|
foreach ($cats as $cat) {
|
|
|
|
if ($cat->parent_id == $parent & !$cat->hide) {
|
|
|
|
if ($cat->parent_id == $parent & !$cat->hide) {
|
|
|
|
$ret .= "<li>";
|
|
|
|
$ret .= "<li class='category-nested-{$cat->id}'>";
|
|
|
|
$ret .= "<a href='" . $cat->webUrl() . "'>";
|
|
|
|
$ret .= "<a href='" . $cat->webUrl() . "'>";
|
|
|
|
$ret .= $cat->name . '</a>';
|
|
|
|
$ret .= $cat->name . '</a>';
|
|
|
|
$ret .= showCatNested($cats, $cat->id);
|
|
|
|
$ret .= showCatNested($cats, $cat->id);
|
|
|
@ -1513,3 +1513,17 @@ function getCategoriesSet($key,$limit=4,$orderBy = 'sort', $asc = 'ASC')
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return \App\Models\Category::whereIn('id',json_decode(getSetting($key) ?? []))->where('hide',0)->limit($limit)->orderBy($orderBy,$asc)->get();
|
|
|
|
return \App\Models\Category::whereIn('id',json_decode(getSetting($key) ?? []))->where('hide',0)->limit($limit)->orderBy($orderBy,$asc)->get();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* get website main categories
|
|
|
|
|
|
|
|
* @param $key
|
|
|
|
|
|
|
|
* @param $limit
|
|
|
|
|
|
|
|
* @param $orderBy
|
|
|
|
|
|
|
|
* @param $asc
|
|
|
|
|
|
|
|
* @return Group[]|\LaravelIdea\Helper\App\Models\_IH_Group_C
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
function getGroupsSet($key,$limit=4,$orderBy = 'sort', $asc = 'ASC')
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return \App\Models\Group::whereIn('id',json_decode(getSetting($key) ?? []))->where('hide',0)->limit($limit)->orderBy($orderBy,$asc)->get();
|
|
|
|
|
|
|
|
}
|
|
|
|