Commit 65c925ce authored by 智勇's avatar 智勇

格式化

空格换成tab
parent 302fa73a
...@@ -12,7 +12,7 @@ if [ $len -ne 11 ];then ...@@ -12,7 +12,7 @@ if [ $len -ne 11 ];then
fi fi
if [ -z $fund_id ];then if [ -z $fund_id ];then
fund_id=140 fund_id=140
fi fi
date=`date "+%Y-%m-%d %H:%M:%S"` date=`date "+%Y-%m-%d %H:%M:%S"`
......
...@@ -13,29 +13,25 @@ date=`date "+%Y-%m-%d %H:%M:%S"` ...@@ -13,29 +13,25 @@ date=`date "+%Y-%m-%d %H:%M:%S"`
function authorization() function authorization()
{ {
len=`echo $phone_no|awk '{print length($0)}'` len=`echo $phone_no|awk '{print length($0)}'`
if [ $len -ne 11 ] if [ $len -ne 11 ]
then then
echo "请输入11位手机号!" echo "请输入11位手机号!"
else else
#查询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}"`
echo "user_id=$user_id" echo "user_id=$user_id"
#插入授信数据0和3
insert_sql0="insert into ${TABLENAME} ("user_id","auth_type","auth_status") values ('$user_id','0',1)"
insert_sql3="insert into ${TABLENAME} ("user_id","auth_type","auth_status") values ('$user_id','3',1)"
#echo "$insert_sql0"
#echo "$insert_sql3"
mysql $mysqld ${DBNAME} -e "${insert_sql0}"
mysql $mysqld ${DBNAME} -e "${insert_sql3}"
echo "done!!! $date"
fi
#插入授信数据0和3
insert_sql0="insert into ${TABLENAME} ("user_id","auth_type","auth_status") values ('$user_id','0',1)"
insert_sql3="insert into ${TABLENAME} ("user_id","auth_type","auth_status") values ('$user_id','3',1)"
#echo "$insert_sql0"
#echo "$insert_sql3"
mysql $mysqld ${DBNAME} -e "${insert_sql0}"
mysql $mysqld ${DBNAME} -e "${insert_sql3}"
echo "done!!! $date"
fi
} }
authorization $ip $phone_no authorization $ip $phone_no
...@@ -12,9 +12,9 @@ mysqld="-h${ip} -P${PORT} -u${USERNAME} -p${PASSWORD}" ...@@ -12,9 +12,9 @@ mysqld="-h${ip} -P${PORT} -u${USERNAME} -p${PASSWORD}"
function doMysql() function doMysql()
{ {
#更新loan_application_history表中的is_active=0 #更新loan_application_history表中的is_active=0
update_sql="update ${TABLENAME} set activity_starttime=\"$start_time\", activity_endtime=\"$end_time\" where id=${act_id}" update_sql="update ${TABLENAME} set activity_starttime=\"$start_time\", activity_endtime=\"$end_time\" where id=${act_id}"
echo ` mysql $mysqld ${DBNAME} -e "${update_sql}"` echo ` mysql $mysqld ${DBNAME} -e "${update_sql}"`
} }
......
...@@ -14,21 +14,21 @@ date=`date "+%Y-%m-%d %H:%M:%S"` ...@@ -14,21 +14,21 @@ date=`date "+%Y-%m-%d %H:%M:%S"`
function closeloan() function closeloan()
{ {
len=`echo $phone_no|awk '{print length($0)}'` len=`echo $phone_no|awk '{print length($0)}'`
if [ $len -ne 11 ] if [ $len -ne 11 ]
then then
echo "请输入11位手机号!" echo "请输入11位手机号!"
else else
#查询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}"`
echo "user_id=$user_id" echo "user_id=$user_id"
#更新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} and is_active=1 and business_type=0" update_sql="update ${TABLENAME} set is_active=0 where user_id=${user_id} and is_active=1 and business_type=0"
mysql $mysqld ${DBNAME} -e "${update_sql}" mysql $mysqld ${DBNAME} -e "${update_sql}"
echo "done!!! $date" echo "done!!! $date"
break break
fi fi
} }
......
...@@ -24,10 +24,10 @@ fi ...@@ -24,10 +24,10 @@ fi
function deleteAlldata() function deleteAlldata()
{ {
len=`echo $phone_no|awk '{print length($0)}'` len=`echo $phone_no|awk '{print length($0)}'`
if [ $len -ne 11 ] if [ $len -ne 11 ]
then then
echo "请输入11位手机号!" echo "请输入11位手机号!"
else else
#各数据库中获取id值 #各数据库中获取id值
xyqb_user_id=`mysql -N $mysqld ${DBNAME} -e "select id from ${TABLENAME} where phone_no=${phone_no}"` xyqb_user_id=`mysql -N $mysqld ${DBNAME} -e "select id from ${TABLENAME} where phone_no=${phone_no}"`
if [ -z $xyqb_user_id ];then if [ -z $xyqb_user_id ];then
...@@ -133,4 +133,4 @@ function deleteAlldata() ...@@ -133,4 +133,4 @@ function deleteAlldata()
fi fi
} }
deleteAlldata $ip $phone_no deleteAlldata $ip $phone_no
...@@ -9,7 +9,7 @@ if [ $len -ne 11 ];then ...@@ -9,7 +9,7 @@ if [ $len -ne 11 ];then
fi fi
if [ -z $account ];then if [ -z $account ];then
account=100 account=100
fi fi
date=`date "+%Y-%m-%d %H:%M:%S"` date=`date "+%Y-%m-%d %H:%M:%S"`
unique_business_id=CASH_LOAN`date +%s%N` unique_business_id=CASH_LOAN`date +%s%N`
......
...@@ -13,22 +13,22 @@ date=`date "+%Y-%m-%d %H:%M:%S"` ...@@ -13,22 +13,22 @@ date=`date "+%Y-%m-%d %H:%M:%S"`
function authorization() function authorization()
{ {
len=`echo $phone_no|awk '{print length($0)}'` len=`echo $phone_no|awk '{print length($0)}'`
if [ $len -ne 11 ] if [ $len -ne 11 ]
then then
echo "请输入11位手机号!" echo "请输入11位手机号!"
else else
#查询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}"`
echo "user_id=$user_id" echo "user_id=$user_id"
insert_sql0="insert into ${TABLENAME} ("user_id","name","phone_no","relation") values ('$user_id',N'哈哈',13312341234,'0')" insert_sql0="insert into ${TABLENAME} ("user_id","name","phone_no","relation") values ('$user_id',N'哈哈',13312341234,'0')"
insert_sql1="insert into ${TABLENAME} ("user_id","name","phone_no","relation") values ('$user_id',N'嘿嘿',13356785678,'1')" insert_sql1="insert into ${TABLENAME} ("user_id","name","phone_no","relation") values ('$user_id',N'嘿嘿',13356785678,'1')"
mysql $mysqld ${DBNAME} -e "${insert_sql0}" mysql $mysqld ${DBNAME} -e "${insert_sql0}"
mysql $mysqld ${DBNAME} -e "${insert_sql1}" mysql $mysqld ${DBNAME} -e "${insert_sql1}"
echo "done!!! $date" echo "done!!! $date"
fi fi
} }
authorization $ip $phone_no authorization $ip $phone_no
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