service = new SettingService( ['mall_id' => $this->mall_id] ); } /** * 设置页面 * * @return void */ public function actionIndex() { if ($this->request->isAjax) { return $this->success( 'ok', ['setting' => $this->service->getSetting()] ); } return $this->render('index'); } /** * 获取配置 * * @return void */ public function actionSave() { if ($this->request->isPost) { $data = $this->request->post(); unset($data['_csrf']); return $this->service->setSetting($data) ? $this->success('ok') : $this->error($this->service->getErrorMsg()); } } }