request->isAjax()) { $list = ConfigModel::select(); $data = []; foreach ($list as $item) { $data[$item['name']] = $item['value']; } return $this->success('操作成功', null, $data); } return $this->view->fetch(); } public function save() { $params = $this->request->post('row/a'); if (!$params) { $this->error('参数错误'); } foreach ($params as $name => $value) { ConfigModel::where('name', $name)->update(['value' => $value]); } $this->success('保存成功'); } }