CommonParams.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace Modules\Common\Repository\Options;
  3. use Catch\Enums\Status as StatusEnum;
  4. use Modules\WechatPlatform\Services\WechatPlatformConstService;
  5. class CommonParams implements OptionInterface
  6. {
  7. public function get(): array
  8. {
  9. /**
  10. * @see modules/Common/config/common.php
  11. */
  12. $commonConfig = config('common.common');
  13. return [
  14. /**
  15. * 支付类型
  16. */
  17. 'payType' => $commonConfig['payType'],
  18. /**
  19. * 小程序类型
  20. */
  21. 'miniprogramType' => $commonConfig['miniprogramType'],
  22. /**
  23. * 首页列表类型
  24. */
  25. 'firstPageListType' => $commonConfig['firstPageListType'],
  26. /**
  27. * 微信公众号运营
  28. */
  29. 'wechatPlatform' => [
  30. 'kfMessageType' => $this->_turn(WechatPlatformConstService::KF_MESSAGE_TYPE_MAPPER),
  31. 'kfMessageStatus' => $this->_turn(WechatPlatformConstService::KF_MESSAGE_STATUS_MAPPER),
  32. ]
  33. ];
  34. }
  35. private function _turn($arr) {
  36. $result = [];
  37. foreach ($arr as $key => $val) {
  38. $result[] = [
  39. 'label' => $val,
  40. 'value' => $key
  41. ];
  42. }
  43. return $result;
  44. }
  45. }