$style, 'list' => $list]; } /** * @notes 底部导航保存 * @param $params * @return bool * @throws \Exception * @author 段誉 * @date 2022/9/7 17:19 */ public static function save($params): bool { $model = new DecorateTabbar(); // 删除旧配置数据 $model->where('id', '>', 0)->delete(); // 保存数据 $tabbars = $params['list'] ?? []; $data = []; foreach ($tabbars as $item) { $data[] = [ 'name' => $item['name'], 'selected' => FileService::setFileUrl($item['selected']), 'unselected' => FileService::setFileUrl($item['unselected']), 'link' => $item['link'], ]; } $model->saveAll($data); if (!empty($params['style'])) { ConfigService::set('tabbar', 'style', $params['style']); } return true; } }