zhaojs
2023-07-06 2cdc89bed9f94a48a8e238f50f8fe8e7225cc49e
application/api/logic/taoke/Parser.php
@@ -26,6 +26,10 @@
    protected static $topLevelName = ""; //顶级等级名称
    protected static $buyCount=-1;//购买次数
    protected static $returnLimit=1;//佣金全返的购买次数限制
    public function __construct(){
        $level = 1;
@@ -42,6 +46,12 @@
        self::$userRate = $leveInfo['own_commission_rate'] * 0.01;
        $topLevelInfo = $ModelUserLevel->where(['level'=>3])->find();
        if(empty($topLevelInfo)) fault('代理配置失败');
        //获取购买次数
        self::$buyCount=0;
        if(self::$buyCount<=self::$returnLimit)
        {//符合全返规则
            self::$userRate =1;
        }
        self::$topFanliRate = $topLevelInfo['own_commission_rate'] * 0.01;
        self::$topLevelName = $topLevelInfo['level_name'];
    }
@@ -183,8 +193,8 @@
    /**
     * 计算商品展示返利金额
     *
     * @param [type] $price
     * @param [type] $commissionRate
     * @param [type] $price 券后价
     * @param [type] $commissionRate 分佣比例
     * @return void
     */
    public static function rebate($price,$commissionRate,$otherRate = "")