开通套餐卡密不按折扣扣款

This commit is contained in:
xiaodaii
2021-07-14 02:00:15 +08:00
parent 50e5b6536d
commit 5d3c77cff2
+4 -1
View File
@@ -1008,7 +1008,10 @@ switch ($_GET['mod']) {
if (!$agentinfo = $db->select_first_row('sq_agent', '*', array('username' => $_SESSION['agent_username']), 'AND')) {
die(json_encode(array('code' => -3, 'msg' => '代理信息获取失败')));
}
$spendmoney = $fidinfo['agentprice'] * $count;
if (!$levelinfo = $db->select_first_row('sq_level', '*', array('ID' => $agentinfo['levelid']), 'AND')) {
die(json_encode(array('code' => -2, 'msg' => '代理对应的等级信息获取失败!')));
}
$spendmoney = $fidinfo['agentprice'] * $count * $levelinfo['fracture'];
if ($spendmoney > $agentinfo['money']){
die(makejson(-10,'代理余额不足'.$spendmoney.',请先进行充值'));
}