model = new \app\admin\model\shopro\commission\Config; } /** * 查看 */ public function index() { if($this->request->isAjax()) { $data = []; if (checkEnv('commission', false)) { $data = $this->model->column('name, value'); } $this->success('分销设置', null, $data); } $this->assignconfig('is_upgrade', checkEnv('commission', false) ? false : true); return $this->view->fetch(); } public function save() { if ($this->request->isPost()) { checkEnv('commission'); $params = $this->request->post(); foreach($params as $k => $p) { $this->model->where('name', $k)->update([ 'value' => $p ]); } $this->success('更新成功'); } } }