递归操作导致内存溢出问题

idcfykj

// 递归处理代理返点
function dailifandian($parentid, $fandian, $amount, $trano, $xiajiid, $xiajiuser, $xiajifandian, $i)
{

    //查找上级的返点
    $where['id'] = $parentid;
    $query = Test::getDb()->query("select id,parentid,fandian,username from member where id={$parentid}");
    if (!empty($query))
    {
        $daili = $query[0];
        $fandianjine = ((($daili['fandian'] - $fandian) / 100)) * $amount;        
        $this->_parent[$i]["fandianjine"] = $fandianjine;
        $this->_parent[$i]["uid"] = $daili['id'];
        $this->_parent[$i]["fandian"] = $daili['fandian'];
        $this->_parent[$i]["xiajiid"] = $xiajiid;
        $this->_parent[$i]["xiajiuser"] = $xiajiuser;
        $this->_parent[$i]["xiajifandian"] = $xiajifandian;
        $this->_parent[$i]["username"] = $daili['username'];
        $this->_parent[$i]["touzhujine"] = $amount;
        $this->_parent[$i]["trano"] = $trano;
        $this->_parent[$i]["oddtime"] = time();
        var_dump($i);

        if (isset($daili['parentid']) && $daili['parentid'] != '0') 
        {
            $i++;
            $this->dailifandian($daili['parentid'], $daili['fandian'], $amount, $trano, $daili['id'], $daili['username'], $daili['fandian'], $i);
        }
    }
}

导致i不断的增加,内存溢出   求有偿解决 qq26567051
1718 3 0
3个回答

idcfykj

111

  • 暂无评论

111

  • 暂无评论
idcfykj

问题已经解决

年代过于久远,无法发表回答
×
🔝