154 Star 1.3K Fork 270

剑走偏锋 / dcat-admin

 / 详情

当使用form->when字段名相同时只会保存最后一个when中的数据

待办的
创建于  
2021-07-26 13:36
$form->radio('type')
                    ->options($this->type)
                    ->when('app', function (Form $form) {
                        $form->multipleSelectTable('target_ids', '应用')
                            ->title('应用列表')
                            ->from(ApplicationTable::make())
                            ->model(ApplicationModels::class, 'id', 'title');
//                            ->options(ApplicationModels::pluck('title', 'id'));
                    })
                    ->when('content', function (Form $form) {
                        $form->multipleSelectTable('target_ids', '内容')
                            ->title('内容列表')
                            ->from(ContentTable::make())
                            ->model(ContentModels::class, 'id', 'title');
//                            ->options(ContentModels::pluck('title', 'id'));
                    })
                    ->default('index');

如下,选择应用列表时,表单提交时会有2个 target_ids 因为只保存最后一个导致,保存了空

评论 (1)

Bincent 创建了任务
Bincent 关联仓库设置为剑走偏锋/dcat-admin
展开全部操作日志

现在都还没有解决这个问题

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
129430 bincent 1670814469
PHP
1
https://gitee.com/jqhph/dcat-admin.git
git@gitee.com:jqhph/dcat-admin.git
jqhph
dcat-admin
dcat-admin

搜索帮助