#!/bin/bash
ip=$1
phone_no_after=$2
phone_no_before=$3

#"请输入新用户手机号:" phone_no_after
#"请输入旧用户手机号:" phone_no_before
mysql -h"$ip" -p"3306" -u"qa" -p"qatest"  <<EOF

use payment_center;
update payment_center.bank_card
set user_id=(select id from payment_center.user where phone_no='$phone_no_after')
where user_id=(select id from payment_center.user where phone_no='$phone_no_before');



update payment_center.bind_card_order
set user_id=(select id from payment_center.user where phone_no='$phone_no_after')
where user_id=(select id from payment_center.user where phone_no='$phone_no_before');

update payment_center.card_bind_info
set user_id=(select id from payment_center.user where phone_no='$phone_no_after')
where user_id=(select id from payment_center.user where phone_no='$phone_no_before');


EOF

echo "————success————"
