prepare("UPDATE withdrawal SET state=?, dk_price=?, notes=?, cl_time=? WHERE id=?");
$stmt->bind_param("ssssi", $state, $dk_price, $notes, $cl_time, $id);
$stmt->execute();
if ($stmt->affected_rows > 0) {
if ($state == 2) {
// 查询代理账户余额
$query = $con->prepare("SELECT proxy_balance FROM proxy WHERE proxy_acc=?");
$query->bind_param("s", $proxy_acc);
$query->execute();
$result = $query->get_result();
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
$proxy_balance = $row['proxy_balance'];
// 更新代理账户余额
$new_proxy_balance = $proxy_balance + $tx_price;
$update = $con->prepare("UPDATE proxy SET proxy_balance=? WHERE proxy_acc=?");
$update->bind_param("ds", $new_proxy_balance, $proxy_acc);
$update->execute();
if ($update->affected_rows > 0) {
echo " ";
} else {
echo ("");
}
} else {
echo ("");
}
} else {
echo " ";
}
} else {
echo ("");
}
}
$con->close();
?>