<?php

namespace app\common\enum;

class CommonEnum
{

    // 系统指定的 商户ID
    const DESIGN_MERCHANT_ID = [
        'MemberZone' => ['code' => 496, 'name' => '会员专区'],
        'WonderfulLiving' => ['code' => 439, 'name' => '精彩生活区'],
        'Repurchase' => ['code' => 491, 'name' => '复购区'],
        'SharedProsperity' => ['code' => 3447, 'name' => '共富区']
    ];


    const IS_DEL = [
        'No' => ['code' => 0, 'name' => '未删除'],
        'Yes' => ['code' => 1, 'name' => '已删除'],
        'Pending' => ['code' => 2, 'name' => '待删除']
    ];

    // 订单类型：根据业务需要进一步扩展
    const ORDER_TYPE = [
        'Platform' => ['code' => 0, 'name' => '平台'],
        'DuoduoJinbao' => ['code' => 1, 'name' => '拼多多'],
        'Vipshop' => ['code' => 2, 'name' => '唯品会'],
        'SuningYigou' => ['code' => 3, 'name' => '苏宁易购'],
        'NetEaseKaola' => ['code' => 4, 'name' => '网易考拉'],
        'TaobaoKe' => ['code' => 5, 'name' => '淘宝客'],
        'JingdongUnion' => ['code' => 6, 'name' => '京东联盟'],
        'Eleme' => ['code' => 7, 'name' => '饿了么'],
        'Online' => ['code' => 8, 'name' => '线上'],
        'MobileTopUp' => ['code' => 9, 'name' => '话费'],
        'Offline' => ['code' => 10, 'name' => '线下'],
        'Platform-Group' => ['code' => 1000, 'name' => '平台-GroupId'], // 该中类型时，依然是 平台订单，只不过 表中的order_id 存储的是
        'XingfuXiaodian' => ['code' => 2001, 'name' => '幸福小店'],
    ];

    // 佣金类型
    const COMMISSION_TYPE = [
        'AGENT_FEE' => ['code' => 1, 'name' => '代理费'],
        'CONSUMPTION_COMMISSION' => ['code' => 2, 'name' => '消费佣金'],
        'DIRECT_REFERRAL' => ['code' => 3, 'name' => '直推奖'],
        'REGION_COMMISSION' => ['code' => 4, 'name' => '辖区佣金'],
        'PENSION' => ['code' => 5, 'name' => '养老金'],
        'AD_FEE' => ['code' => 6, 'name' => '广告费'],
        'LOCKED_CUSTOMER' => ['code' => 7, 'name' => '锁客收益'],
        'PLATFORM_REWARD' => ['code' => 8, 'name' => '平台奖励'],
        'CHANNEL_DEALER' => ['code' => 9, 'name' => '渠道商'],
        'SHOP_REWARD' => ['code' => 10, 'name' => '推广店铺收益'],
        'PARTNER_DIVIDEND' => ['code' => 11, 'name' => '合伙人分红'],
        'JOINT_CREATOR_DIVIDEND' => ['code' => 12, 'name' => '联创分红'],
        'EQUITY_DIVIDEND' => ['code' => 13, 'name' => '股权分红'],
        'SHARE_EARNINGS' => ['code' => 20, 'name' => '分享收益'],
        'COMMISSION_RECORD_V1.0' => ['code' => 21, 'name' => '1.0佣金记录'],
        'SHARED_PROSPERITY_PARTNER_COMMISSION' => ['code' => 101, 'name' => '共富体系合伙人分红佣金奖励'],
        'SHARED_PROSPERITY_THANK_COMMISSION' => ['code' => 102, 'name' => '共富体系感恩奖佣金奖励'],
        'SHARED_PROSPERITY_GROUP_COMMISSION' => ['code' => 103, 'name' => '共富体系共富奖佣金奖励'],
    ];

    const USER_GROUP = [
        'RegularUser' => ['code' => 1, 'name' => '普通用户'],
        'Salesperson' => ['code' => 2, 'name' => '业务员'],
        'SalesManager' => ['code' => 3, 'name' => '业务经理'],
        'JuniorPartner' => ['code' => 4, 'name' => '初级合伙人'],
        'Mid-LevelPartner' => ['code' => 5, 'name' => '中级合伙人'],
        'SeniorPartner' => ['code' => 6, 'name' => '中级合伙人'],
        'Director' => ['code' => 7, 'name' => '董事']
    ];

    // 直推奖励的分配比例
    const DIRECT_REFERRAL_BONUS = [
        'BrokeragePrice' => ['code' => 0.9, 'name' => '直推奖励的佣金部分'],
        'Fugou' => ['code' => 0.1, 'name' => '直推奖励的佣金部分']
    ];

    // 计算式小数点保留位数 超出位数 舍弃
    const CALCULATE_THE_NUMBER_OF_DECIMAL_PLACES = 5;
    // 金额保留小数点位 超出部分舍弃
    const DECIMAL_PLACES_OF_THE_AMOUNT = 2;
    // 平台手续费(汇付通道服务费)
    const HUIFU_COMMISSION_CHARGE = 0.0038;

    // 提现额度比例 ['SharedProsperity']['Self']['WithdrawalLimit']['Ratio']['code']
    const WITHDRAWAL_LIMIT_RATIO = 5;

    // 订单 收益 的分配
    const ORDER_EARNING_ALLOCATION = [
        // 精彩生活区
        'WonderfulLiving' => [
            'Self' => [
                'YangLaoJin' => [ // 钱
                    'Ratio' => ['code' => 0.3, 'name' => '将利润的30%，当做养老金分配给下单人']
                ],
                'Hongbao' => [ // 钱
                    'Ratio' => ['code' => 0.1575, 'name' => '将利润的35% * 45%，当做红包分配给下单人，前提下单人是老用户（35% * 45%）']
                ],
                'Score' => [ // 钱
                    'Ratio' => ['code' => 0.35, 'name' => '将利润的35%，当做积分值分配给下单人']
                ],
                'Pv' => [ // 数据 算业绩
                    'Ratio' => ['code' => 0.35, 'name' => '将利润的35%，当做PV值分配给下单人']
                ],
                'Gongxian' => [ // 数据 升级用
                    'Ratio' => ['code' => 0.35, 'name' => '将利润的35%，当做贡献值分配给下单人']
                ]
            ],
            'Spread' => [
                'BrokeragePrice' => [
                    'Ratio' => ['code' => 0.35 * 0.9, 'name' => '将商品利润中 用户身份对应分配比例 的推荐人可分配利润中 35% * 90% ，直推奖励的佣金部分'],
                ],
                'Fugou' => [
                    'Ratio' => ['code' => 0.35 * 0.1, 'name' => '将商品利润中 用户身份对应分配比例 的推荐人可分配利润中 35% * 10% ，直推奖励的复购部分'],
                ],
                'Gongxian' => [
                    'Ratio' => ['code' => 0.35, 'name' => '将利润的35%，当做贡献值分配给推荐人']
                ],
                'Score' => [
                    'Ratio' => ['code' => 0.35, 'name' => '将商品利润中 用户身份对应分配比例 的推荐人可分配利润中 35%，当做积分值分配给推荐人']
                ],
                'YangLaoJin' => [
                    'Ratio' => ['code' => 0.35 * 0.05, 'name' => '将利润的35%中的5%，当做养老金分配给推荐人']
                ]
            ],
            'Share' => [
                'BrokeragePrice' => [
                    'Ratio' => ['code' => 0.35 * 0.03 * 0.9, 'name' => '将利润的 35% 中的 3% 中的 90%，做为分享奖励的佣金部分'],
                ],
                'Fugou' => [
                    'Ratio' => ['code' => 0.35 * 0.03 * 0.1, 'name' => '将利润的 35% 中的 3% 中的 10%，做为分享奖励的复购部分'],
                ]
            ],
            'Lock' => [
                'BrokeragePrice' => [
                    'Ratio' => ['code' => 0.35 * 0.05 * 0.9, 'name' => '将利润的 35% 中的 5% 中的 90%，做为锁客奖励的佣金部分'],
                ],
                'Fugou' => [
                    'Ratio' => ['code' => 0.35 * 0.05 * 0.1, 'name' => '将利润的 35% 中的 5% 中的 10%，做为锁客奖励的复购部分'],
                ]
            ]
        ],
        'MemberZone' => [
            'Fixed' => [
                'Basic' => [ // 售价 => 基础计算价格 (历史原因：原价是1000、2000...等，后来单间成本价上调了180，所以售价调整了，考虑到涨价前后的奖励应保持一致，所以设置了基础计算值)
                    '1180.00' => 1000.00,
                    '2360.00' => 2000.00,
                    '5900.00' => 5000.00,
                    '9440.00' => 8000.00,
                    '10620.00' => 9000.00,
                    '11800.00' => 10000.00
                ]
            ],
            'Self' => [
                // 养老金比例
                'YangLaoJin' => [
                    'Ratio' => ['code' => 0.035, 'name' => '将3.5%，当做养老金分配给下单人']
                ],
                'Gongxian' => [
                    'Ratio' => ['code' => 0.7, 'name' => '将利润的35%，当做贡献值分配给下单人']
                ],
                'Pv' => [
                    'Ratio' => ['code' => 0.7, 'name' => '将70%，当做PV值分配给下单人']
                ],
                'Score' => [
                    'Ratio' => ['code' => 0.7, 'name' => '将利润的35%，当做积分值分配给下单人']
                ]
            ],
            'Spread' => [
                'IdentityRatio' => [
                    1 => 0.1,
                    2 => 0.3,
                    3 => 0.3,
                    4 => 0.3,
                    5 => 0.3,
                    6 => 0.3,
                    7 => 0.3,
                ],
                'BrokeragePrice' => [
                    'Ratio' => ['code' => 0.9, 'name' => '直推奖励的佣金部分'],
                ],
                'Fugou' => [
                    'Ratio' => ['code' => 0.1, 'name' => '直推奖励的复购部分'],
                ],
                'Gongxian' => [
                    'Ratio' => ['code' => 0.7, 'name' => '将70%，当做贡献值分配给推荐人'],
                    'RegularUserRatio' => ['code' => 0.7 * 0.3, 'name' => '将70% * 30%，当做贡献值分配给推荐人(普通用户)'],
                ],
                'Score' => [
                    'Ratio' => ['code' => 0.7, 'name' => '将用户身份等级对应的直推分润的70%，当做积分值分配给推荐人']
                ],
                'YangLaoJin' => [
                    'Ratio' => ['code' => 0.035, 'name' => '将3.5%，当做养老金分配给推荐人']
                ]
            ]
        ],
        'Repurchase' => [
            'Self' => [
                // 养老金比例
                'YangLaoJin' => [
                    'Ratio' => ['code' => 0.5, 'name' => '将50%，当做养老金分配给下单人']
                ]
            ],
            'SpreadDirectly' => [
                // 养老金比例 直接推荐人
                'YangLaoJin' => [
                    'Ratio' => ['code' => 0.3, 'name' => '将30%，当做养老金分配给直推人']
                ]
            ],
            'SpreadIndirectly' => [
                // 养老金比例 间接推荐人
                'YangLaoJin' => [
                    'Ratio' => ['code' => 0.2, 'name' => '将20%，当做养老金分配给间推人']
                ]
            ]
        ],
        'CommercialDistrict' => [
            'Self' => [
                'YangLaoJin' => [ // 钱
                    'Ratio' => ['code' => 0.3, 'name' => '将利润的30%，当做养老金分配给下单人']
                ],
                'Hongbao' => [ // 钱
                    'Ratio' => ['code' => 0.35 * 0.45, 'name' => '将利润的35% * 45%，当做红包分配给下单人，前提下单人是老用户（35% * 45%）']
                ],
                'Score' => [ // 钱
                    'Ratio' => ['code' => 0.35, 'name' => '将利润的35%，当做积分值分配给下单人']
                ],
                'Pv' => [ // 数据 算业绩
                    'Ratio' => ['code' => 0.35, 'name' => '将利润的35%，当做PV值分配给下单人']
                ],
                'Gongxian' => [ // 数据 升级用
                    'Ratio' => ['code' => 0.35, 'name' => '将利润的35%，当做贡献值分配给下单人']
                ]
            ],
            'Spread' => [
                'BrokeragePrice' => [
                    'Ratio' => ['code' => 0.35 * 0.9, 'name' => '将商品利润中 用户身份对应分配比例 的推荐人可分配利润中 35% * 90% ，直推奖励的佣金部分'],
                ],
                'Fugou' => [
                    'Ratio' => ['code' => 0.35 * 0.1, 'name' => '将商品利润中 用户身份对应分配比例 的推荐人可分配利润中 35% * 10% ，直推奖励的复购部分'],
                ],
                'Gongxian' => [
                    'Ratio' => ['code' => 0.35, 'name' => '将利润的35%，当做贡献值分配给推荐人']
                ],
                'Score' => [
                    'Ratio' => ['code' => 0.35, 'name' => '将商品利润中 用户身份对应分配比例 的推荐人可分配利润中 35%，当做积分值分配给推荐人']
                ],
                'YangLaoJin' => [
                    'Ratio' => ['code' => 0.35 * 0.05, 'name' => '将利润的35%中的5%，当做养老金分配给推荐人']
                ]
            ],
            'Lock' => [
                'BrokeragePrice' => [
                    'Ratio' => ['code' => 0.35 * 0.05 * 0.9, 'name' => '将利润的 35% 中的 5% 中的 90%，做为锁客奖励的佣金部分'],
                ],
                'Fugou' => [
                    'Ratio' => ['code' => 0.35 * 0.05 * 0.1, 'name' => '将利润的 35% 中的 5% 中的 10%，做为锁客奖励的复购部分'],
                ]
            ]
        ],
        // 共富区
        'SharedProsperity' => [
            'Self' => [
                'YangLaoJin' => [
                    'Ratio' => ['code' => 0.05, 'name' => '将订单消费金额的5%，当做养老金分配给下单人']
                ],
                'ConsumerStocks' => [
                    'Ratio' => ['code' => 0.5, 'name' => '在共富区消费者获得购买商品赠送商品额50%的消费股']
                ],
                'WithdrawalLimit' => [
                    'Ratio' => ['code' => 5, 'name' => '消费配额1:5提现（需要提现的会员，需有提现配额才能提现，例：消费1000，配5000的提现额度）']
                ]
            ],
            'Spread' => [
                'YangLaoJin' => [
                    'Ratio' => ['code' => 0.03, 'name' => '将订单消费金额的3%，当做养老金分配给推荐人']
                ],
                'ConsumerStocks' => [
                    'Ratio' => ['code' => 0.5, 'name' => '在共富区推广者获得购买商品赠送商品额50%的消费股']
                ]
            ],
            'Thank' => ['code' => 0.1, 'name' => '感恩奖分配比例，10%'],
            'Hierarchy' => ['code' => 5, 'name' => '会员层级，5层'],
        ],
        'Pdd' => [
            'CommissionDistributionRatio' => [
                'Ratio' => ['code' => 1, 'name' => '拼多多的佣金分配比例']
            ],
            'Pv' => [
                'Ratio' => ['code' => 0.7, 'name' => '将订单利润的70%作为PV值']
            ],
            'Self' => [
                'YangLaoJin' => [
                    'Ratio' => ['code' => 0.3, 'name' => '将订单利润的30%，当做养老金分配给下单人']
                ]
            ],
            'Spread' => [
                'YangLaoJin' => [
                    'Ratio' => ['code' => 0.05, 'name' => '将订单PV的百分之5，当做养老金分配给推荐人']
                ], 'BrokeragePrice' => [
                    'Ratio' => ['code' => 0.9, 'name' => '将商品利润中 用户身份对应分配比例 的推荐人可分配利润中 90% ，直推奖励的佣金部分'],
                ], 'Fugou' => [
                    'Ratio' => ['code' => 0.1, 'name' => '将商品利润中 用户身份对应分配比例 的推荐人可分配利润中 10% ，直推奖励的复购部分'],
                ]
            ]
        ],
    ];

}