充值卡实名和成年
This commit is contained in:
@@ -32,6 +32,20 @@ class Payment extends Controller
|
|||||||
if (!$user_id) {
|
if (!$user_id) {
|
||||||
return V(0, '请选择充值用户', null);
|
return V(0, '请选择充值用户', null);
|
||||||
}
|
}
|
||||||
|
//获取用户的手机号
|
||||||
|
$user_phone = db::name('user')->where(["id" => $user_id])->value('mobile');
|
||||||
|
if(!$user_phone){
|
||||||
|
return V(0, '请先绑定手机号!', null);
|
||||||
|
}
|
||||||
|
//获取用户的实名信息
|
||||||
|
$real_name = db::name('user_auth')->where(["mobile" => $user_phone,'is_real' => 1])->find();
|
||||||
|
if(!$real_name){
|
||||||
|
return V(0, '请先实名认证', null);
|
||||||
|
}
|
||||||
|
//获取用户的年龄
|
||||||
|
if(!getAgeId($real_name['card_id'])){
|
||||||
|
return V(0, '未成年不可充值!', null);
|
||||||
|
}
|
||||||
|
|
||||||
if (!is_numeric($money) || floor($money) != $money || $money <= 0 || $money >= 2000) {
|
if (!is_numeric($money) || floor($money) != $money || $money <= 0 || $money >= 2000) {
|
||||||
return V(0, '请选择正确的充值金额', null);
|
return V(0, '请选择正确的充值金额', null);
|
||||||
|
|||||||
Reference in New Issue
Block a user