Commit e4c26815 authored by zhangbo0329's avatar zhangbo0329

优化资金方放款脚本

parent efd8a588
......@@ -19,22 +19,27 @@ function coltho_chanpin()
{
len=`echo $phone_no|awk '{print length($0)}'`
if [ $len -ne 11 ];then
echo "请输入11位手机号!"
else
echo "请输入11位手机号!"
exit -1
fi
if [ -z "$chanpin" ];then
chanpin=QG_FIX0_6000_6
fi
#查询userID
select_sql="select id from ${TABLENAME2} where phone_no=${phone_no}"
user_id=`mysql -N $mysqld ${DBNAME2} -e "${select_sql}"`
echo "user_id=$user_id"
update_sql0="update ${TABLENAME} set quantify_product_name='${chanpin}' where xyqb_user_id=$user_id"
update_sql1="update ${TABLENAME1} set quantify_product_name='${chanpin}' where xyqb_user_id=$user_id"
echo "sql0=$update_sql0"
echo "sql1=$update_sql1"
update_sql0="update ${TABLENAME} set quantify_product_name='${chanpin}' where xyqb_user_id=$user_id order by id desc limit 1"
update_sql1="update ${TABLENAME1} set quantify_product_name='${chanpin}' where xyqb_user_id=$user_id order by id desc limit 1"
# echo "sql0=$update_sql0"
# echo "sql1=$update_sql1"
mysql $mysqld ${DBNAME} -e "${update_sql0}"
mysql $mysqld ${DBNAME1} -e "${update_sql1}"
echo "done!!! $date"
fi
}
coltho_chanpin $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