<?php

namespace Modules\Common\Services;

class CommonConfigService
{
    /**
     * 获取首页列表类型映射
     * @return mixed[]
     * <pre>
     * [
     *   1 => [
     *      'label' => 'xxx',
     *      'value' => 1,
     *   ],
     * ]
     * </pre>
     */
    public static function getFirstPageListTypeMap() {
        return collect(config('common.common.firstPageListType'))->keyBy('value')->toArray();
    }
    /**
     * 获取小程序类型映射
     * @return mixed[]
     * <pre>
     * [
     *   1 => [
     *      'label' => 'xxx',
     *      'value' => 1,
     *   ],
     * ]
     * </pre>
     */
    public static function getMiniprogramTypeMap() {
        return collect(config('common.common.miniprogramType'))->keyBy('value')->toArray();
    }

    /**
     * 获取支付类型映射
     * @return mixed[]
     * <pre>
     * [
     *   1 => [
     *      'label' => 'xxx',
     *      'value' => 1,
     *   ],
     * ]
     * </pre>
     */
    public static function getPayTypeMap() {
        return collect(config('common.common.payType'))->keyBy('value')->toArray();
    }
}
