fix: 后台banner分类接口
This commit is contained in:
@@ -34,12 +34,12 @@ class Banner
|
||||
$datas = [];
|
||||
if (!$banners->isEmpty()) {
|
||||
$temp = [];
|
||||
$map = ['pc' => 'PC端', 'mobile' => '移动端'];
|
||||
$map = ['pc' => ['id' => -1, 'name' => 'PC端'], 'mobile' => ['id' => -2, 'name' => '移动端']];
|
||||
foreach ($banners as $banner) {
|
||||
if (!isset($temp[$banner->at_platform])) {
|
||||
$temp[$banner->at_platform] = [
|
||||
'id' => 0,
|
||||
'name' => $map[$banner->at_platform] ?? '未知平台',
|
||||
'id' => $map[$banner->at_platform]['id'] ?? 0,
|
||||
'name' => $map[$banner->at_platform]['name'] ?? '未知平台',
|
||||
'children' => []
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user