getResponse(); if ($app_id) { $firstColumn = AppNewsColumn::query()->where('website', $app_id)->get()->toArray(); $res = []; foreach ($firstColumn as $index => &$column) { $filter = []; $filter[] = ['column_tag', $column['id']]; $res[] = [ 'filter' => $filter, 'desc' => $column['desc'], 'item' => [['title' => $column['name'], 'link' => $column['url']]], 'path' => $column['url'], ]; $second = AppNewsSecondColumn::query()->where('rid', $column['id'])->get()->toArray(); if ($second) { foreach ($second as $secondCol) { $appendArr = []; $appendArr[] = ['title' => $column['name'], 'link' => $column['url']]; $appendArr[] = ['title' => $secondCol['name'], 'link' => $column['url'] . $secondCol['url']]; $filter = [ ['column_tag', $column['id']], ['second_column', $secondCol['id']] ]; $res[] = [ 'filter' => $filter, 'path' => "{$column['url']}{$secondCol['url']}", 'desc' => $secondCol['desc'], 'item' => $appendArr, ]; } } } return $resp->setCode(200)->setData($res)->send(); } return $resp->setCode(200)->send(); } }