objMBasicSetup = new MBasicSetup($this->onlineEnterpriseId); } /** * 添加,编辑数据 * @return array */ public function commonFieldFilter() { $params = $this->request->getRawJson(); if (empty($params)) { $this->sendOutput('参数为空', ErrorCode::$paramError); } $data = [ 'enterpriseId' => $this->onlineEnterpriseId, 'basicData' => isset($params['basicData']) ? json_encode($params['basicData']) : '', ]; foreach ($data as $key => $value) { if (empty($value) && $value !== 0) { $this->sendOutput($key . '参数错误', ErrorCode::$paramError); } } return $data; } /** * 编辑基本设置 */ public function setting() { $data = $this->commonFieldFilter(); $result = $this->objMBasicSetup->setting($data); if ($result->isSuccess()) { parent::sendOutput($result->getData()); } else { parent::sendOutput($result->getData(), $result->getErrorCode()); } } /** * 获取基本设置 */ public function getBasicSetup() { $result = $this->objMBasicSetup->getBasicSetup(); if ($result->isSuccess()) { parent::sendOutput($result->getData()); } else { parent::sendOutput($result->getData(), $result->getErrorCode()); } } }