feat(PayNotifyLogic): 更新支付通知逻辑,修复错误,优化代码

This commit is contained in:
mkm 2024-06-23 19:07:44 +08:00
parent 5ac2750227
commit 3723c9c047

View File

@ -145,7 +145,6 @@ class PayNotifyLogic extends BaseLogic
OrderLogic::lessWriteOff($params);
}
self::dealProductLog($order);
}
@ -404,8 +403,7 @@ class PayNotifyLogic extends BaseLogic
$vipFen = $oldUser['purchase_funds'];
}
}
}
elseif ($user['user_ship'] == 1 && $order['pay_type'] != PayEnum::CASH_PAY){
} elseif ($user['user_ship'] == 1 && $order['pay_type'] != PayEnum::CASH_PAY) {
$vipFrozenAmount = self::dealFrozenPrice($order['id']);
//为1的时候要去减活动价
// $final_price = bcsub($order['pay_price'],$order['deduction_price'],2);
@ -557,12 +555,14 @@ class PayNotifyLogic extends BaseLogic
// 'user_ship' => 3,
// ];
if ($village_uid > 0) {
SystemStore::where('id', $village_uid)->inc('store_money', $fees)->update();
$financeLogic->other_arr['vip_uid'] = $village_uid;
}
$financeLogic->in($transaction_id, $fees, OrderEnum::VILLAGE_ORDER_OBTAINS, $order['store_id'], 0, 0, $order['pay_type']);
$financeLogic->out($transaction_id, $fees, OrderEnum::VILLAGE_ORDER_OBTAINS, $order['store_id'], $order['staff_id'], 0, $order['pay_type']);
//队长获得
if ($brigade_uid > 0) {
SystemStore::where('id', $brigade_uid)->inc('store_money', $fees)->update();
$financeLogic->other_arr['vip_uid'] = $brigade_uid;
}
$financeLogic->in($transaction_id, $fees, OrderEnum::BRIGADE_ORDER_OBTAINS, $order['store_id'], 0, 0, $order['pay_type']);
@ -691,7 +691,6 @@ class PayNotifyLogic extends BaseLogic
(new StoreProductLog())->saveAll($productLog);
}
return true;
}
@ -711,11 +710,9 @@ class PayNotifyLogic extends BaseLogic
'swap' => $StoreBranchProduct['swap'] - $v['cart_num'],
'sales' => ['inc', $v['cart_num']]
];
}
(new StoreBranchProduct())->saveAll($updateData);
}
@ -743,13 +740,8 @@ class PayNotifyLogic extends BaseLogic
'stock' => $StoreBranchProduct['stock'] - $v['cart_num'],
'sales' => ['inc', $v['cart_num']]
];
}
(new StoreBranchProduct())->saveAll($updateData);
}
}