request->isAjax) { $service = new SettingService(['mall_id' => $this->mall_id]); $data = $service->getSetting(); return $this->success('ok', $data); } return $this->render('index'); } /** * 提交设置 * * @return void */ public function actionSubmit() { if ($this->request->isAjax) { $service = new SettingService(['mall_id' => $this->mall_id]); $data = $this->request->post(); $service->attributes = $data; $service->setSetting(); return $this->success(); } } /** * 调试 * * @return void */ public function actionDebug() { if ($this->request->isPost) { $type = $this->request->post('type'); return ($service = new DebugService(['mall_id' => $this->mall_id]))->hander($type) ? $this->success('ok', $service->getResult()) : $this->error($service->getError()); } return $this->render('debug'); } }