view->assign('commissionConfig', $commissionConfig ?: []); return $this->view->fetch(); } /** * 编辑配置 */ public function edit($ids = null) { if ($this->request->isPost()) { $this->token(); $params = $this->request->post("row/a", [], 'trim'); if ($params) { // try { // 特殊处理某些配置项 if (isset($params['become_agent']) && is_array($params['become_agent'])) { $params['become_agent'] = json_encode($params['become_agent'], JSON_UNESCAPED_UNICODE); } // 更新配置 ShopConfigService::setConfigs('shop.commission', $params); $this->success('配置保存成功'); // } catch (ValidateException $e) { // $this->error($e->getMessage()); // } catch (PDOException $e) { // $this->error($e->getMessage()); // } catch (\Exception $e) { // $this->error($e->getMessage()); // } } $this->error(__('Parameter %s can not be empty', '')); } } }