0) { $row = mysqli_fetch_assoc($result); $proxy_acc = $row['proxy_acc']; $proxy_balance = $row['proxy_balance']; // 根据type进行不同的操作 if ($type == 0) { $new_balance = $proxy_balance + $price; $update_sql = "UPDATE proxy SET proxy_balance = $new_balance WHERE proxy_id = $proxy_id"; mysqli_query($con, $update_sql); // 在revenue表中新增数据 $insert_sql = "INSERT INTO revenue (account, oderid, type, price, beizhu, fund_notes, oder_sta, state, cr_time, dz_time) VALUES ('$proxy_acc', '$oderid', $type, $price, '$notes', '$notes', 3, 2, $sutime, $sutime)"; mysqli_query($con, $insert_sql); } elseif ($type == 1) { $new_balance = $proxy_balance - $price; $update_sql = "UPDATE proxy SET proxy_balance = $new_balance WHERE proxy_id = $proxy_id"; mysqli_query($con, $update_sql); // 在revenue表中新增数据 $insert_sql = "INSERT INTO revenue (account, oderid, type, price, beizhu, fund_notes, oder_sta, state, cr_time, dz_time) VALUES ('$proxy_acc', '$oderid', $type, $price, '$notes', '$notes', 3, 3, $sutime, $sutime)"; mysqli_query($con, $insert_sql); } // 在revenue表中新增数据 // $insert_sql = "INSERT INTO revenue (account, oderid, type, price, beizhu, fund_notes, oder_sta, state, cr_time, dz_time) VALUES ('$proxy_acc', '$oderid', $type, $price, '$notes', '$notes', 3, 3, $sutime, $sutime)"; // mysqli_query($con, $insert_sql); // 执行成功后的操作 echo ""; } else { // 商品不存在的操作 echo ""; } mysqli_close($con); ?>