12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- namespace JinDouYun\Controller\System;
- use JinDouYun\Controller\BaseController;
- use JinDouYun\Model\System\MProcessSetting;
- use Mall\Framework\Core\ErrorCode;
- /**
- * @copyright Copyright (c) https://www.qianniaovip.com All rights reserved
- * Description: 流程设置
- * Class ProcessSetting
- * @package JinDouYun\Controller\System
- */
- class ProcessSetting extends BaseController
- {
- /**
- * @var MProcessSetting
- */
- private $objMProcessSetting;
- /**
- * ProcessSetting constructor.
- * @param bool $isCheckAcl
- * @param bool $isMustLogin
- * @param bool $checkToken
- * @param bool $getAreaCode
- */
- public function __construct($isCheckAcl = true, $isMustLogin = true, $checkToken = true, $getAreaCode = false)
- {
- parent::__construct($isCheckAcl, $isMustLogin, $checkToken, $getAreaCode);
- $this->objMProcessSetting = new MProcessSetting($this->onlineEnterpriseId);
- }
- /**
- * Doc: (des="设置")
- * User: XMing
- * Date: 2020/11/6
- * Time: 11:47 上午
- */
- public function set()
- {
- $params = $this->request->getRawJson();
- if (empty($params)) {
- parent::sendOutput('参数为空', ErrorCode::$paramError);
- }
- $data = [];
- foreach ($params as $key => $param){
- $data[$key] = [
- 'processType' => isset($param['processType']) ? $param['processType'] : null,
- 'content' => isset($param['content']) ? json_encode($param['content']) : null,
- 'enterpriseId' => $this->onlineEnterpriseId,
- 'id' => isset($param['id']) ? $param['id'] : null,
- ];
- foreach ($data[$key] as $k => $v) {
- if (is_null($v)) {
- parent::sendOutput($k . '参数错误', ErrorCode::$paramError);
- }
- }
- }
- $result = $this->objMProcessSetting->set($data);
- if ($result->isSuccess()) {
- parent::sendOutput($result->getData());
- }
- parent::sendOutput($result->getData(), $result->getErrorCode());
- }
- /**
- * Doc: (des="配置列表")
- * User: XMing
- * Date: 2020/11/6
- * Time: 12:16 下午
- */
- public function getAll()
- {
- $result = $this->objMProcessSetting->getAll();
- if ($result->isSuccess()) {
- parent::sendOutput($result->getData());
- }
- parent::sendOutput($result->getData(), $result->getErrorCode());
- }
- }
|