refactor: pc header数据改两列显示
All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 4s
All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 4s
This commit is contained in:
@@ -120,7 +120,13 @@ abstract class Common extends BaseController
|
||||
}
|
||||
$children = $this->toTreeAndChunk($categorys, $item['id'], $lv);
|
||||
if (!empty($children)) {
|
||||
$item['children'] = $item['level'] == 1 ? array_chunk($children, 2) : $children;
|
||||
if ($lv == 1) {
|
||||
$item['children'] = array_chunk($children, 2);
|
||||
} else if ($lv == 2) {
|
||||
$item['children'] = array_chunk($children, 3);
|
||||
} else {
|
||||
$item['children'] = $children;
|
||||
}
|
||||
}
|
||||
$ret[] = $item;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user