修改店铺支付逻辑和回调处理逻辑

This commit is contained in:
liu 2024-06-18 18:25:08 +08:00
parent d4ee97c5ad
commit ea4e67a38f
2 changed files with 20 additions and 5 deletions

View File

@ -306,13 +306,24 @@ class PayNotifyLogic extends BaseLogic
if ($order['uid'] > 0) {
// 结算金额 要支付的钱减去冻结得钱去走后面得逻辑 发得兑换券也要去减去
$vipFrozenAmount = self::dealFrozenPrice($order['id']);
$order['pay_price'] = bcsub($order['pay_price'],$vipFrozenAmount,2);
//用户下单该用户等级为1得时候才处理冻结金额
$user = User::where('id', $order['uid'])->find();
if ($user['user_ship'] == 1) {
//纯在分销关系的时候要去判断分销出来的用户的采购款的额度
if ($order['spread_uid'] > 0 && $user['user_ship'] == 1) {
$oldUser = User::where('id',$order['spread_uid'])->value('purchase_funds');
if ($oldUser < $order['pay_price']) {
$order['pay_price'] = $oldUser;
}
}elseif ($user['user_ship'] == 1){
$vipFrozenAmount = self::dealFrozenPrice($order['id']);
//为1的时候要去减活动价
$final_price = bcsub($order['pay_price'],$order['deduction_price'],2);
$order['pay_price'] = bcsub($final_price,$vipFrozenAmount,2);
self::dealVipAmount($order, $order['pay_type']);
}
$user_number = bcmul($order['pay_price'], '0.10', 2);
$sing = [
'uid' => $order['uid'],
@ -325,6 +336,7 @@ class PayNotifyLogic extends BaseLogic
User::where('id', $order['uid'])->inc('integral', $user_number)->update();
}
$financeLogic->order = $order;
$financeLogic->user = ['uid' => $order['uid']];
// if ($order->pay_type != 9 || $order->pay_type != 10) {

View File

@ -110,8 +110,11 @@ class StoreOrderLogic extends BaseLogic
self::$store_price = bcadd(self::$store_price, $cart_select[$k]['store_price'], 2);//门店零售价格
// self::$profit = bcadd(self::$profit, $cart_select[$k]['profit'], 2);
}
$pay_price =bcsub(self::$pay_price, self::$activity_price, 2); //减去活动优惠金额
if ($user && $user['user_ship'] == 1) {
$pay_price = self::$pay_price;
}else{
$pay_price =bcsub(self::$pay_price, self::$activity_price, 2); //减去活动优惠金额
}
$vipPrice = 0;
//成本价 收益