Commit 9958de83 authored by tywldx's avatar tywldx
parents a7311e68 90dc0d68
......@@ -20,6 +20,12 @@ function authorization()
#查询userID
select_sql="select id from ${TABLENAME1} where phone_no=${phone_no}"
user_id=`mysql -N $mysqld ${DBNAME} -e "${select_sql}"`
if [ -z $user_id ];then
uuid=$(uuidgen)
insert_sql="insert into ${TABLENAME1} ("phone_no","registered_from","uuid","enable") values ('${phone_no}','111','$uuid','1')"
mysql $mysqld ${DBNAME} -e "${insert_sql}"
user_id=`mysql -N $mysqld ${DBNAME} -e "${select_sql}"`
fi
uuid=`mysql -N $mysqld ${DBNAME} -e "select uuid from ${TABLENAME1} where phone_no=${phone_no}"`
echo "user_id=$user_id"
echo "uuid=$uuid"
......
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