service = new ConfigService(['mall_id'=>$this->mall_id]); } /** * 首页 * * @return string */ public function actionIndex() { if(!$this->request->isAjax){ return $this->render('index'); } } public function actionGetConfig(){ $config = $this->service->getConfig($this->mall_id); return $this->success('',empty($config) ? '' : $config); } public function actionSave(){ $data = $this->request->post(); $data['mall_id'] = $this->mall_id; $res = $this->service->save($data); return $res ? $this->success("操作成功") : $this->error($this->service->error); } }