更新兼容性

This commit is contained in:
yaooo 2023-11-17 16:39:49 +08:00
parent 4e48919944
commit 35de09d273

View File

@ -99,11 +99,13 @@ class RechargeLogic extends BaseLogic
]);
// 更新用户余额及累计充值金额
User::where(['id' => $order['user_id']])
->dec('total_recharge_amount', $order['order_amount'])
->dec('user_money', $order['order_amount'])
->update();
$userInfo = User::where(['id' => $order['user_id']])->findOrEmpty();
if ($userInfo['total_recharge_amount'] >= $order['order_amount']) {
User::where(['id' => $order['user_id']])
->dec('total_recharge_amount', $order['order_amount'])
->dec('user_money', $order['order_amount'])
->update();
}
// 记录日志
AccountLogLogic::add(
$order['user_id'],