更新
This commit is contained in:
@@ -60,10 +60,10 @@ class Withdrawal extends adminApi
|
||||
$where['a.createtime'] = ['>=', strtotime($search_stime)];
|
||||
}
|
||||
if($search_etime !== ''){
|
||||
$where['a.createtime'] = ['<=', strtotime($search_etime.' 23:59:59')];
|
||||
$where['a.createtime'] = ['<=', strtotime($search_etime)];
|
||||
}
|
||||
if(!empty($search_stime) && !empty($search_etime)){
|
||||
$where['a.createtime'] = ['between',[strtotime($search_stime),strtotime($search_etime.' 23:59:59')]];
|
||||
$where['a.createtime'] = ['between',[strtotime($search_stime),strtotime($search_etime)]];
|
||||
}
|
||||
$count = db::name('vs_user_withdrawal')->alias('a')
|
||||
->join('user b', 'a.user_id = b.id', 'left')
|
||||
@@ -75,6 +75,7 @@ class Withdrawal extends adminApi
|
||||
->field('a.*,b.nickname,b.user_code')
|
||||
->order('a.createtime desc')
|
||||
->where($where)
|
||||
->page($page, $page_limit)
|
||||
->select();
|
||||
$data_lists = [];
|
||||
foreach ($lists as $key => $value) {
|
||||
@@ -255,19 +256,23 @@ class Withdrawal extends adminApi
|
||||
//查询该用户云账户提现金额
|
||||
$had_money = db::name('vs_user_withdrawal')->where(['user_id'=>$withdraw_info['user_id'],'deal_type'=>2,'status'=>6])->where('pay_time','month')->sum('general_money');
|
||||
$max_month_money = 98000;
|
||||
if(($had_money+$withdraw_info['general_money']) >= 98000){
|
||||
if(($had_money+$withdraw_info['general_money']) >= $max_month_money){
|
||||
return ['code' => 0, 'msg' => '单人单月云账户提现金额最大为98000元!', 'data' => null];
|
||||
}
|
||||
//查询该用户信息
|
||||
$user_info = model('api/user')->get_user_info($withdraw_info['user_id']);
|
||||
$user_info = model('api/user')->get_user_info($withdraw_info['user_id'], ['user','user_auth']);
|
||||
if(empty($user_info)){
|
||||
return ['code' => 0, 'msg' => '用户信息错误!', 'data' => null];
|
||||
}
|
||||
|
||||
$real_name = $user_info['real_name'];
|
||||
$id_card = $user_info['card_id'];
|
||||
$order_id = $withdraw_info['order_sn'];
|
||||
$order_amount = $withdraw_info['general_money'];
|
||||
$phone = $user_info['mobile'];
|
||||
if(empty($phone)) {
|
||||
return ['code' => 0, 'msg' => '请先绑定手机号', 'data' => null];
|
||||
}
|
||||
if (empty($real_name) || empty($id_card)) {
|
||||
return ['code' => 0, 'msg' => '请先实名认证', 'data' => null];
|
||||
}
|
||||
@@ -281,7 +286,11 @@ class Withdrawal extends adminApi
|
||||
}
|
||||
$card_no = $user_info['alipay_account'];
|
||||
$yun_pay = new YunPay($order_id, $real_name, $id_card, $card_no, $order_amount,$phone);
|
||||
$result = $yun_pay->alipay();
|
||||
$user_data = [
|
||||
'nickname' => $user_info['nickname'],
|
||||
'user_id' => $withdraw_info['user_id'],
|
||||
];
|
||||
$result = $yun_pay->alipay($user_data);
|
||||
} elseif ($withdraw_info['type'] == 3) {
|
||||
if(empty($user_info['bank_card_number'])){
|
||||
return ['code' => 0, 'msg' => '请先绑定银行卡号', 'data' => null];
|
||||
|
||||
Reference in New Issue
Block a user