<?php
namespace app\event;
use support\think\Db;
use Request;
class Recharge{
    function success($row=[]){
        $data = $row;
        if(!is_array($row)){
            $data = $data->toArray();
        }
        cache_add('user_recharge_total_'.$data['user_id'],$data['amount']);
        $parent_id = get_parent_id($data['user_id']);
        if($parent_id){
            //团队提现统计
            cache_add('team_recharge_total_'.$parent_id,$data['amount']);
        }
        //系统每日提现统计
        $date = date('Y-m-d');
        cache_add('statistics_recharge_times_'.$date,1);
        cache_add('statistics_recharge_amount_'.$date,$data['amount']);
        return $row;
    }
}