init admin
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
namespace app\event;
|
||||
use app\model\User as UserModel;
|
||||
use support\think\Db;
|
||||
use Request;
|
||||
class Withdrawl{
|
||||
function success($row=[]){
|
||||
$data = $row;
|
||||
if(!is_array($row)){
|
||||
$data = $data->toArray();
|
||||
}
|
||||
//用户提现统计
|
||||
cache_add('user_withdrawl_total_'.$data['user_id'],$data['deduction_amount']);
|
||||
// $parent_id = get_parent_id($data['user_id']);
|
||||
// if($parent_id){
|
||||
// //团队提现统计
|
||||
// cache_add('team_withdrawl_total_'.$parent_id,$data['deduction_amount']);
|
||||
// //提现奖励
|
||||
|
||||
// $distributed_users = jicha($data['user_id'],$data['deduction_amount'],[0,0.01,0.02,0.03,0.05,0.05]);
|
||||
// foreach($distributed_users as $k=>$v){
|
||||
// UserModel::money($v['user_id'],$v['amount'],\app\enum\BalanceType::OUTPUT_REWARD,$data['id']);
|
||||
// cache_add('user_income_total_'.$v['user_id'],$v['amount']);
|
||||
// cache_add('user_withdrawl_reward_'.$v['user_id'],$v['amount']);
|
||||
// }
|
||||
// }
|
||||
//系统每日提现统计
|
||||
$date = date('Y-m-d');
|
||||
cache_add('statistics_withdrawl_times_'.$date,1);
|
||||
cache_add('statistics_withdrawl_amount_'.$date,$data['deduction_amount']);
|
||||
|
||||
//cache_add('withdrawl_pass_total',$data['deduction_amount']);
|
||||
//cache_add('withdrawl_pass_times',1);
|
||||
return $row;
|
||||
}
|
||||
function reject($row=[]){
|
||||
$data = $row;
|
||||
if(!is_array($row)){
|
||||
$data = $data->toArray();
|
||||
}
|
||||
// cache_add('withdrawl_pass_total',-$data['deduction_amount']);
|
||||
// cache_add('withdrawl_pass_times',-1);
|
||||
return $row;
|
||||
}
|
||||
function created($row=[]){
|
||||
$data = $row;
|
||||
if(!is_array($row)){
|
||||
$data = $data->toArray();
|
||||
}
|
||||
return $row;
|
||||
}
|
||||
function transfering($row=[]){
|
||||
$data = $row;
|
||||
if(!is_array($row)){
|
||||
$data = $data->toArray();
|
||||
}
|
||||
// cache_add('user_withdrawl_total_'.$data['user_id'],$data['deduction_amount']);
|
||||
// $parent_id = get_parent_id($data['user_id']);
|
||||
// if($parent_id){
|
||||
// cache_add('team_withdrawl_total_'.$parent_id,$data['deduction_amount']);
|
||||
// }
|
||||
post(Config('pay.server').'/index/withdrawl',[
|
||||
'appid' => config('pay.appid'),
|
||||
'amount' => $data['recive_amount'],
|
||||
'network' => $data['network'],
|
||||
'out_trade_no' => $data['id'],
|
||||
'address' => $data['address'],
|
||||
'notify_url' => config('pay.notify_server').'/api/withdrawl/notify',
|
||||
//'from_address' => $config['from_address'],
|
||||
//'private_key' => $config['private_key'],
|
||||
'env' => 'product'
|
||||
]);
|
||||
return $row;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user