user_id; $money = $payment_refund->amount; $mall_id = $payment_refund->mall_id; $insert_wallet [] = [ 'mall_id' => $mall_id, 'user_id' => $user_id, 'is_frozen' => false, 'wallet_type' => UserWalletService::WALLET_TYPE_SCORE, 'money' => $money, 'desc' => $desc, 'source_table' => $source_table, 'source_table_id' => $source_table_id, 'from_type' => $from_type, 'capital_type' => $capital_type, 'order_no' => $order_no ]; $res = UserWalletService::batchHandleByQueue($insert_wallet); if ($res == false) throw new \Exception(UserWalletService::getStaticError()); $payment_refund->is_pay = 1; $res = $payment_refund->save(); if ($res == false) throw new \Exception('生成余额退款记录失败'); return true; } catch (\Exception $e) { self::setStaticError($e->getMessage()); return false; } } }