ApiBasicSetup.Class.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. /**
  3. * 基本设置
  4. * Created by PhpStorm.
  5. * User: XiaoMing
  6. * Date: 2019/12/6
  7. * Time: 11:48
  8. */
  9. namespace JinDouYun\Controller\System;
  10. use JinDouYun\Controller\BaseController;
  11. use JinDouYun\Model\System\MAppVersion;
  12. use JinDouYun\Model\System\MBasicSetup;
  13. use Mall\Framework\Core\ErrorCode;
  14. class ApiBasicSetup extends BaseController
  15. {
  16. /**
  17. * @var MBasicSetup
  18. */
  19. private $objMBasicSetup;
  20. /**
  21. * @var MAppVersion
  22. */
  23. private $objMAppVersion;
  24. /**
  25. * TemplateModule constructor.
  26. * @param bool $isCheckAcl
  27. * @param bool $isMustLogin
  28. */
  29. public function __construct($isCheckAcl = false, $isMustLogin = false)
  30. {
  31. parent::__construct($isCheckAcl, $isMustLogin);
  32. $this->objMBasicSetup = new MBasicSetup($this->onlineEnterpriseId);
  33. $this->objMAppVersion = new MAppVersion($this->onlineEnterpriseId);
  34. }
  35. /**
  36. * 获取基本设置配置项
  37. */
  38. public function getBasicField()
  39. {
  40. $field = $this->request->param('field');
  41. if (empty($field)){
  42. $this->sendOutput('参数错误', ErrorCode::$paramError );
  43. }
  44. $result = $this->objMBasicSetup->getBasicField($field);
  45. if ($result->isSuccess()) {
  46. parent::sendOutput($result->getData());
  47. }
  48. parent::sendOutput($result->getData(), $result->getErrorCode());
  49. }
  50. /**
  51. * 获取app版本及地址
  52. */
  53. public function getVersion()
  54. {
  55. $oldVersion = $this->request->param('oldVersion');
  56. $result = $this->objMAppVersion->getVersion($oldVersion);
  57. if ($result->isSuccess()) {
  58. parent::sendOutput($result->getData());
  59. }
  60. parent::sendOutput($result->getData(), $result->getErrorCode());
  61. }
  62. public function over_examination()
  63. {
  64. parent::sendOutput(0);
  65. }
  66. }