需求按钮状态优化

This commit is contained in:
Dev
2026-10-28 16:59:16 +08:00
parent f552fb957f
commit d47beb3f56
13 changed files with 166 additions and 43 deletions
@@ -96,7 +96,7 @@ class DemandDeal extends Command
Db::transaction(function () use ($item) {
//根据订单列表查找冻结金额日志,根据冻结日志解冻冻结金额到余额
$userId = $item->winBidding->user_id;
$settleTotalAmount = 0;
$settleTotalAmount = '0';
foreach ($item->orders as $order) {
$logWhere = [
'user_id' => $userId,
@@ -109,7 +109,7 @@ class DemandDeal extends Command
$log = AccountLogService::where($logWhere)->find();
if ($log) {
$amount = $log->amount;
$settleTotalAmount += $amount;
$settleTotalAmount = bcadd($settleTotalAmount, (string)$amount, 2);
//写入余额日志
$title = OrderService::ORDER_TYPE_MAP[$order->order_type] ?? '需求收益';
$log_res = AccountLogService::addLog(AccountLogService::ACCOUNT_TYPE_FREEZE, $userId, $amount, $title . '解冻-冻结金额扣除', AccountLogService::TYPE_UNFREEZE, 0, AccountLogService::INC_EXP_EXPEND, $order->id, $order->total_amount);
@@ -134,7 +134,7 @@ class DemandDeal extends Command
$msgData = [
'values' => [
$item->parent_order_no,
round($settleTotalAmount, 2),
$settleTotalAmount,
SubscribeMessageService::MSG_MAP[SubscribeMessageService::MSG_TEMP_DEMAND_SETTLE]['remark'],
]
];