objMTemplateModule = new MTemplateModule($this->onlineUserId, $this->onlineEnterpriseId); } /** * 添加,编辑系统模版模块 * @return array */ public function commonFieldFilter() { $params = $this->request->getRawJson(); if (empty($params)) { $this->sendOutput('参数为空', ErrorCode::$paramError); } $data = [ 'templateId' => isset($params['templateId']) ? $params['templateId'] : '', 'title' => isset($params['title']) ? $params['title'] : '', ]; foreach ($data as $key => $value) { if (empty($value) && $value !== 0) { $this->sendOutput($key . '参数错误', ErrorCode::$paramError); } } $data['enableStatus'] = isset($params['enableStatus']) ? $params['enableStatus'] : StatusCode::$delete; return $data; } /** * 获取系统模板下模块 */ public function getAll() { $templateId = $this->request->param('request_id'); if (empty($templateId)){ $this->sendOutput('缺少模板id', ErrorCode::$paramError); } $selectParams = [ 'templateId' => $templateId, 'enableStatus' => StatusCode::$standard, ]; $dbResult = $this->objMTemplateModule->getAll($selectParams); if ($dbResult->isSuccess()) { $returnData = $dbResult->getData(); parent::sendOutput($returnData['data'], 0); } parent::sendOutput($dbResult->getData(), ErrorCode::$dberror); } }