* @date 2017/02/15 18:05 */ class Config extends BasicAdmin { protected $table = 'SystemConfig'; public function index() { if (!$this->request->isPost()) { $this->title = '系统参数配置'; parent::_list($this->table); } else { $data = $this->request->post(); foreach ($data as $key => $vo) { $_data = ['name' => $key, 'value' => $vo]; Data::save($this->table, $_data, 'name'); } $this->success('数据修改成功!', ''); } } public function file() { if (!$this->request->isPost()) { $this->title = '文件存储配置'; parent::_list($this->table); } else { $data = $this->request->post(); foreach ($data as $key => $vo) { $_data = ['name' => $key, 'value' => $vo]; Data::save($this->table, $_data, 'name'); } $this->success('数据修改成功!', ''); } } }