CommonConfigService.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace Modules\Common\Services;
  3. class CommonConfigService
  4. {
  5. /**
  6. * 获取首页列表类型映射
  7. * @return mixed[]
  8. * <pre>
  9. * [
  10. * 1 => [
  11. * 'label' => 'xxx',
  12. * 'value' => 1,
  13. * ],
  14. * ]
  15. * </pre>
  16. */
  17. public static function getFirstPageListTypeMap() {
  18. return collect(config('common.common.firstPageListType'))->keyBy('value')->toArray();
  19. }
  20. /**
  21. * 获取小程序类型映射
  22. * @return mixed[]
  23. * <pre>
  24. * [
  25. * 1 => [
  26. * 'label' => 'xxx',
  27. * 'value' => 1,
  28. * ],
  29. * ]
  30. * </pre>
  31. */
  32. public static function getMiniprogramTypeMap() {
  33. return collect(config('common.common.miniprogramType'))->keyBy('value')->toArray();
  34. }
  35. /**
  36. * 获取支付类型映射
  37. * @return mixed[]
  38. * <pre>
  39. * [
  40. * 1 => [
  41. * 'label' => 'xxx',
  42. * 'value' => 1,
  43. * ],
  44. * ]
  45. * </pre>
  46. */
  47. public static function getPayTypeMap() {
  48. return collect(config('common.common.payType'))->keyBy('value')->toArray();
  49. }
  50. }