master
elf 11 months ago
parent 66c5e3e78b
commit 9fd8f52c1c

@ -1996,7 +1996,7 @@ function get_default_payment_config($way=1) {
}
// 获取支付配置 way 1 支付宝 2微信 3快捷
function get_payment_config($way=1, $game=0, $user_id=0, $pay_amount = 0, $isPlatform = false) {
function get_payment_config($way=1, $game=0, $user_id=0, $pay_amount = 0, $skipOuterPay = false) {
$time = time();
$company = get_promote_company($user_id);
@ -2020,7 +2020,7 @@ function get_payment_config($way=1, $game=0, $user_id=0, $pay_amount = 0, $isPla
// $monthEnd = date('Y-m-d', strtotime(date('Y-m-01') . '+1 month -1 day'));
// $payAmountRow = M('spend','tab_')->field('SUM(pay_amount) as sum_amount')->where(array('pay_way'=>41, 'pay_real_status'=>1, 'payed_time' => ['gt', $monthBegin], 'payed_time' => ['lt', $monthEnd]))->find();
// $payAmount = intval($payAmountRow['sum_amount']);
if ($pay_amount >= 500 && !$isPlatform) {
if ($pay_amount >= 500 && !$skipOuterPay) {
return ['code' => 0, 'msg' => '', 'data' => ['id' => 3, 'channel' => 11, 'config' => '{}']];
}

@ -912,7 +912,7 @@ class BaseController extends RestController
* 优先扣除绑币 和平台 处理
* $request $discountAmount 折扣价格
*/
public function other_price(&$request, $discountAmount=0, $pay_info = []) {
public function other_price(&$request, $discountAmount=0) {
// 优先扣除绑定币平台币
if ($request['code'] == '0') return $request; // 平台币充值 不做判断
$deductionAmount = 0;
@ -935,10 +935,6 @@ class BaseController extends RestController
}
}
$actualAmount = round($request['price'] - $discountAmount - $deductionAmount, 2).'';
if ($pay_info['channel'] == 11 && $deductionAmount > 0 && $actualAmount > 0) {
$deductionAmount = 0;
}
// 实际支付金额 = 支付总金额 - 折扣抵扣价格 - 绑币和平台币抵扣金额
$request['actual_amount'] = round($request['price'] - $discountAmount - $deductionAmount, 2).'';
$request['discount_amount'] = round($discountAmount, 2).'';

@ -426,13 +426,18 @@ class PayH5Controller extends BaseController{
$request['discount'] = $discount;
}
$pay_info = get_payment_config(self::ALI_PAY, $game, $request['user_id'], $request['price']);
$this->other_price($request, $discountAmount);
$skipOuterPay = false;
if ($request['deduction_amount'] > 0) {
$skipOuterPay = true;
}
$pay_info = get_payment_config(self::ALI_PAY, $game, $request['user_id'], $request['price'], $skipOuterPay);
if ($pay_info['code'] != 0) {
echo json_encode(['code'=>1010,'msg'=> $pay_info['msg']]);
exit;
}
$this->other_price($request, $discountAmount, $pay_info);
$main_id = $pay_info['data']['main_id'];
$pay_conf = json_decode($pay_info['data']['config'], true);

Loading…
Cancel
Save