Commit 7822a97d authored by qa_quantgroup's avatar qa_quantgroup

更新sql脚本

parent 0cfd7684
#!/bin/bash #!/bin/bash
ip=$1 ip=$1
phone_no=$2 phone_no=$2
date=`date "+%Y-%m-%d %H:%M:%S"`
mysql -h"$ip" -p"3306" -u"qa" -p"qatest" <<EOF mysql -h"$ip" -p"3306" -u"qa" -p"qatest" <<EOF
update xyqb.loan_application_history update xyqb.loan_application_history
set xyqb.loan_application_history.progress=40 set xyqb.loan_application_history.progress=40
where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1; where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1;
EOF EOF
echo "done!!!" echo "done!!! $date"
...@@ -43,4 +43,4 @@ set progress=0 ...@@ -43,4 +43,4 @@ set progress=0
where phone_no=$phone_no where phone_no=$phone_no
EOF EOF
echo "done!!!" echo "done!!! $date"
...@@ -9,5 +9,9 @@ update xyqb.loan_application_history ...@@ -9,5 +9,9 @@ update xyqb.loan_application_history
set xyqb.loan_application_history.progress=21 set xyqb.loan_application_history.progress=21
where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1; where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1;
update xyqb.loan_application_manifest_history
set transaction_status=1
where loan_application_history_id=(select id from xyqb.loan_application_history where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1);
EOF EOF
echo "done!!!" echo "done!!! $date"
...@@ -12,7 +12,7 @@ set xyqb.loan_application_history.progress=15 ...@@ -12,7 +12,7 @@ set xyqb.loan_application_history.progress=15
where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1; where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1;
update xyqb.loan_application_manifest_history update xyqb.loan_application_manifest_history
set loan_paid_at='$date' set loan_paid_at='$date',transaction_status=2
where loan_application_history_id=(select id from xyqb.loan_application_history where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1); where loan_application_history_id=(select id from xyqb.loan_application_history where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1);
update xyqb.page_state_info update xyqb.page_state_info
...@@ -20,4 +20,5 @@ set state='ViewRepayState' ...@@ -20,4 +20,5 @@ set state='ViewRepayState'
where loan_id=(select id from xyqb.loan_application_history where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1); where loan_id=(select id from xyqb.loan_application_history where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1);
EOF EOF
echo "done!!!" date=`date "+%Y-%m-%d %H:%M:%S"`
echo "done!!! $date"
...@@ -8,6 +8,7 @@ DBNAME="spider_center" ...@@ -8,6 +8,7 @@ DBNAME="spider_center"
TABLENAME="user_authorization" TABLENAME="user_authorization"
TABLENAME1="user" TABLENAME1="user"
mysqld="-h${ip} -P${PORT} -u${USERNAME} -p${PASSWORD}" mysqld="-h${ip} -P${PORT} -u${USERNAME} -p${PASSWORD}"
date=`date "+%Y-%m-%d %H:%M:%S"`
function authorization() function authorization()
{ {
...@@ -16,7 +17,6 @@ function authorization() ...@@ -16,7 +17,6 @@ function authorization()
then then
echo "请输入11位手机号!" echo "请输入11位手机号!"
else else
echo "开始修改"
#查询userID #查询userID
select_sql="select id from ${TABLENAME1} where phone_no=${phone_no}" select_sql="select id from ${TABLENAME1} where phone_no=${phone_no}"
user_id=`mysql -N $mysqld ${DBNAME} -e "${select_sql}"` user_id=`mysql -N $mysqld ${DBNAME} -e "${select_sql}"`
...@@ -30,7 +30,7 @@ function authorization() ...@@ -30,7 +30,7 @@ function authorization()
#echo "$insert_sql3" #echo "$insert_sql3"
mysql $mysqld ${DBNAME} -e "${insert_sql0}" mysql $mysqld ${DBNAME} -e "${insert_sql0}"
mysql $mysqld ${DBNAME} -e "${insert_sql3}" mysql $mysqld ${DBNAME} -e "${insert_sql3}"
echo "修改成功" echo "done!!! $date"
break break
fi fi
......
...@@ -9,6 +9,7 @@ TABLENAME="loan_application_history" ...@@ -9,6 +9,7 @@ TABLENAME="loan_application_history"
DBNAME1="xyqb_user" DBNAME1="xyqb_user"
TABLENAME1="user" TABLENAME1="user"
mysqld="-h${ip} -P${PORT} -u${USERNAME} -p${PASSWORD}" mysqld="-h${ip} -P${PORT} -u${USERNAME} -p${PASSWORD}"
date=`date "+%Y-%m-%d %H:%M:%S"`
function closeloan() function closeloan()
{ {
...@@ -17,7 +18,6 @@ function closeloan() ...@@ -17,7 +18,6 @@ function closeloan()
then then
echo "请输入11位手机号!" echo "请输入11位手机号!"
else else
echo "开始修改"
#查询userID #查询userID
select_sql="select id from ${TABLENAME1} where phone_no=${phone_no}" select_sql="select id from ${TABLENAME1} where phone_no=${phone_no}"
user_id=`mysql -N $mysqld ${DBNAME1} -e "${select_sql}"` user_id=`mysql -N $mysqld ${DBNAME1} -e "${select_sql}"`
...@@ -26,7 +26,7 @@ function closeloan() ...@@ -26,7 +26,7 @@ function closeloan()
#更新loan_application_history表中的is_active=0 #更新loan_application_history表中的is_active=0
update_sql="update ${TABLENAME} set is_active=0 where user_id=${user_id}" update_sql="update ${TABLENAME} set is_active=0 where user_id=${user_id}"
mysql $mysqld ${DBNAME} -e "${update_sql}" mysql $mysqld ${DBNAME} -e "${update_sql}"
echo "修改成功" echo "done!!! $date"
break break
fi fi
......
...@@ -54,7 +54,7 @@ function deleteAlldata() ...@@ -54,7 +54,7 @@ function deleteAlldata()
mysql $mysqld ${DBNAME2} -e "delete from waiting_funding_corp_operate_people where loan_application_history_id in ($loan_id)" mysql $mysqld ${DBNAME2} -e "delete from waiting_funding_corp_operate_people where loan_application_history_id in ($loan_id)"
mysql $mysqld ${DBNAME2} -e "delete from user_contact where user_id=$xyqb_user_id" mysql $mysqld ${DBNAME2} -e "delete from user_contact where user_id=$xyqb_user_id"
echo "删除cash-loan-flow数据,loan_id=$loan_id" echo "删除cash-loan-flow数据"
mysql $mysqld cash_loan_flow -e "delete from order_progress_record where loan_id in ($loan_id)" mysql $mysqld cash_loan_flow -e "delete from order_progress_record where loan_id in ($loan_id)"
fi fi
...@@ -94,6 +94,7 @@ function deleteAlldata() ...@@ -94,6 +94,7 @@ function deleteAlldata()
echo "删除红包系统数据" echo "删除红包系统数据"
mysql $mysqld redpacket -e "delete from redpacket_mall where phone_no=$phone_no" mysql $mysqld redpacket -e "delete from redpacket_mall where phone_no=$phone_no"
mysql $mysqld redpacket -e "delete from tb_coupon where phone=$phone_no"
echo "删除谛听中心数据" echo "删除谛听中心数据"
mysql $mysqld risk_control -e "delete from review_history where phone_no=$phone_no" mysql $mysqld risk_control -e "delete from review_history where phone_no=$phone_no"
......
...@@ -16,5 +16,5 @@ fi ...@@ -16,5 +16,5 @@ fi
#ip=`/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"` #ip=`/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"`
resp=`curl "http://$ip:7037/app/login?registerFrom=$registerFrom&phoneNo=$phone_no" 2>/dev/null` resp=`curl "http://$ip:7037/app/login?registerFrom=$registerFrom&phoneNo=$phone_no" 2>/dev/null`
token=`echo $resp | jq ".data.token" | sed "s/\"//g"` token=`echo $resp | jq ".data.token" | sed "s/\"//g"`
echo $token echo "token: $token"
echo "http://$ip:7001/app-landing?token=$token&registerFrom=$registerFrom&channelId=1" echo "http://$ip:7001/app-landing?token=$token&registerFrom=$registerFrom&channelId=1"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment