123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?php
- /**
- * 分类设置
- * Created by PhpStorm.
- * User: 小威
- * Date: 2020/03/10
- * Time: 09:45
- */
- namespace JinDouYun\Controller\System;
- use JinDouYun\Controller\BaseController;
- use Mall\Framework\Core\ErrorCode;
- use Mall\Framework\Core\StatusCode;
- use JinDouYun\Model\System\MClassSetting;
- class ClassSetting extends BaseController
- {
- private $objMClassSetting;
- /**
- * TemplateModule constructor.
- * @param bool $isCheckAcl
- * @param bool $isMustLogin
- */
- public function __construct($isCheckAcl = true, $isMustLogin = true)
- {
- parent::__construct($isCheckAcl, $isMustLogin);
- $this->objMClassSetting = new MClassSetting($this->onlineUserId, $this->onlineEnterpriseId);
- }
- /**
- * 添加,编辑分类设置
- */
- public function setClassSetting()
- {
- $params = $this->request->getRawJson();
- if (empty($params)) {
- $this->sendOutput('参数为空', ErrorCode::$paramError);
- }
- $data = [
- 'enterpriseId' => $this->onlineEnterpriseId,
- 'content' => isset($params) ? $params : '',
- ];
- foreach ($data as $key => $value) {
- if (empty($value) && $value !== 0) {
- $this->sendOutput($key . '参数错误', ErrorCode::$paramError);
- }
- }
- $modelResult = $this->objMClassSetting->setClassSetting($data);
- if(!$modelResult->isSuccess()){
- parent::sendOutput($modelResult->getData(), ErrorCode::$dberror);
- }
- parent::sendOutput($modelResult->getData());
- }
- /**
- * 获取分类设置
- */
- public function getClassSettingInfo()
- {
- $selectParams = [
- 'enterpriseId' => $this->onlineEnterpriseId,
- ];
- $modelResult = $this->objMClassSetting->getClassSettingInfo($selectParams);
- if (!$modelResult->isSuccess()) {
- parent::sendOutput($modelResult->getData(), $modelResult->getErrorCode());
- }
- parent::sendOutput($modelResult->getData());
- }
- }
|