更新
This commit is contained in:
@@ -43,6 +43,13 @@ class UserWithdrawal extends Model
|
||||
if(!$age){
|
||||
return ['code' => 0, 'msg' => '该身份证号未满18岁', 'data' => null];
|
||||
}
|
||||
if(empty($type)){
|
||||
return ['code' => 0, 'msg' => '请选择提现方式', 'data' => null];
|
||||
}
|
||||
//提现不能有小数
|
||||
if($number != floor($number)){
|
||||
return ['code' => 0, 'msg' => '提现不能有小数!', 'data' => null];
|
||||
}
|
||||
//判断用户是否签约云账户
|
||||
$yun_pay = new YunPay();
|
||||
$sign_status = $yun_pay->getApiUserSignStatus($user_info['real_name'],$user_info['card_id']);
|
||||
@@ -192,10 +199,10 @@ class UserWithdrawal extends Model
|
||||
$where['createtime'] = ['>=',strtotime($search_stime)];
|
||||
}
|
||||
if($search_etime){
|
||||
$where['createtime'] = ['<=',strtotime($search_etime.' 23:59:59')];
|
||||
$where['createtime'] = ['<=',strtotime($search_etime)];
|
||||
}
|
||||
if(!empty($search_stime) && !empty($search_etime)){
|
||||
$where['createtime'] = ['between',[strtotime($search_stime),strtotime($search_etime.' 23:59:59')]];
|
||||
$where['createtime'] = ['between',[strtotime($search_stime),strtotime($search_etime)]];
|
||||
}
|
||||
$withdraw_list = db::name('vs_user_withdrawal')
|
||||
->where($where)
|
||||
@@ -207,6 +214,26 @@ class UserWithdrawal extends Model
|
||||
$return_data[$key]['money'] = $value['money'];
|
||||
$return_data[$key]['status'] = $value['status'];
|
||||
$return_data[$key]['status_str'] = $this->withdraw_status[$value['status']];
|
||||
//手续费
|
||||
$return_data[$key]['withdraw_fee'] = $value['server_money'] ?? 0;
|
||||
$return_data[$key]['personal_tax_rate'] = $value['personal_tax_rate'] ?? 0; //税率
|
||||
$return_data[$key]['received_tax_amount'] = $value['received_tax_amount'] ?? 0; //税费
|
||||
//预计到账金额
|
||||
//1待处理2已通过3已拒绝 4打款中[云账户]5打款失败[云账户]6已打款[云账户]
|
||||
if($value['status'] == 1 || $value['status'] == 2 || $value['status'] ==4){
|
||||
$surplus_money = $value['money'] - $value['server_money'];
|
||||
$return_data[$key]['received_tax_amount'] = 0;
|
||||
}elseif($value['status'] == 3 || $value['status'] ==5){
|
||||
$surplus_money = $value['money'];
|
||||
$return_data[$key]['withdraw_fee'] = 0;
|
||||
$return_data[$key]['received_tax_amount'] = 0;
|
||||
}elseif($value['status'] == 6){
|
||||
$surplus_money = $value['money'] - $value['server_money'] - $value['received_tax_amount'];
|
||||
}else{
|
||||
$surplus_money = $value['money'];
|
||||
}
|
||||
$return_data[$key]['surplus_money'] = round($surplus_money,2);
|
||||
|
||||
$return_data[$key]['createtime'] = date('Y-m-d H:i:s',$value['createtime']);
|
||||
}
|
||||
return ['code' => 1, 'msg' => '成功', 'data' => $return_data];
|
||||
|
||||
Reference in New Issue
Block a user