Commit 7e5ef071 authored by qa_quantgroup's avatar qa_quantgroup

增加红包脚本

parent 16a15729
#!/bin/bash
ip=$1
phone_no=$2
card_no=622700000`date +%s`
echo $card_no
mysql -h"$ip" -p"3306" -u"qa" -p"qatest" <<EOF
use payment_center;
delete from payment_center.bank_card where user_id=111112222233333;
delete from payment_center.card_bind_info where user_id=111112222233333;
delete from payment_center.bind_card_order where user_id=111112222233333;
delete from payment_center.bank_card where card_no=6227000010912341234;
delete from payment_center.card_bind_info where card_no=6227000010912341234;
delete from payment_center.bank_card_detail where card_no=6227000010912341234;
delete from payment_center.bank_card where card_no='$card_no';
delete from payment_center.card_bind_info where card_no='$card_no';
delete from payment_center.bank_card_detail where card_no='$card_no';
INSERT INTO payment_center.bank_card (user_id, card_no, card_top, card_last, card_type, card_holder_name, preserve_phone_no, bank_name, bank_code, branch_no, branch_name, city, province, valid_from, valid_thru)
VALUES
(111112222233333, '6227000010912341234', '622700', '1234', 2, N'小测', '18610271234', N'建设银行', 'CCB', NULL, NULL, '110102', '110000', NULL, NULL);
(111112222233333, '$card_no', '622700', '1234', 2, N'小测', '18610271234', N'建设银行', 'CCB', NULL, NULL, '110102', '110000', NULL, NULL);
INSERT INTO payment_center.bank_card_detail (bank_name, bank_code, card_no, account_property, card_type, is_valid)
VALUES
('建设银行', 'CCB', '6227000010912341234', '00', 2, 1);
(N'建设银行', 'CCB', '$card_no', '00', 2, 1);
INSERT INTO payment_center.bind_card_order (user_id, merchant_id, merchant_order_no, pay_approach, ext_data, bind_status, sms_error_code, confirm_error_code, request_id)
VALUES
(111112222233333, 3, '43779518', 1, '', 5, '', '', 'yeepay1488525851371');
INSERT INTO payment_center.card_bind_info (user_id, pay_approach, bind_id, bank_card_id, is_active, card_no, bind_valid_thru)
VALUES
(111112222233333, 1, '1488525851371', 1492596, 1, '6227000010912341234', NULL);
(111112222233333, 1, '1488525851371', 1492596, 1, '$card_no', NULL);
update payment_center.bank_card t set t.user_id=(select id from payment_center.user where phone_no =$phone_no) where t.user_id=111112222233333;
update payment_center.bind_card_order t set t.user_id=(select id from payment_center.user where phone_no =$phone_no) where t.user_id=111112222233333;
update payment_center.card_bind_info t set t.user_id=(select id from payment_center.user where phone_no =$phone_no),bank_card_id=(select id from payment_center.bank_card where card_no=6227000010912341234 and user_id=(select id from payment_center.user where phone_no =$phone_no)) where t.user_id=111112222233333;
update payment_center.bank_card t set t.user_id=(select id from payment_center.user where phone_no ='$phone_no') where t.user_id=111112222233333;
update payment_center.bind_card_order t set t.user_id=(select id from payment_center.user where phone_no ='$phone_no') where t.user_id=111112222233333;
update payment_center.card_bind_info t set t.user_id=(select id from payment_center.user where phone_no ='$phone_no'),bank_card_id=(select id from payment_center.bank_card where card_no=$card_no and user_id=(select id from payment_center.user where phone_no ='$phone_no') order by id desc limit 1) where t.user_id=111112222233333;
EOF
echo "done!!!"
#!/bin/bash
ip=$1
phone_no=$2
account=$3
if [ -z $account ];then
account=100
fi
date=`date "+%Y-%m-%d %H:%M:%S"`
unique_business_id=CASH_LOAN`date +%s%N`
echo "unique_business_id:"$unique_business_id
mysql -h"$ip" -p"3306" -u"qa" -p"qatest" <<EOF
INSERT INTO redpacket.tb_coupon (unique_business_id, phone, group_id, name, category, category_info, category_type, category_type_info, valid_start_date, valid_end_date, sms_reminder_on_invalid, status, created_at, used_at, updated_at, mark, uid)
VALUES
('$unique_business_id', '$phone_no', 10000574, N'小测福利', 8, '{\"loanTerm\":[\"1\",\"2\",\"3\"]}', 3, '{\"rebate\":$account}', '2017-01-01 00:00:13', '2020-06-14 00:00:23', 0, 2, '$date', NULL, '$date', 1, NULL);
EOF
echo "done!!!"
#!/bin/bash
ip=$1
phone_no=$2
mysqld="-h$ip -p3306 -uqa -pqatest"
user_id=`mysql -N $mysqld xyqb_user -e "select id from user where phone_no=$phone_no"`
echo "user.id:"$user_id
mysql -N $mysqld xyqb_user -e "delete from contact where user_id=$user_id"
redis_key="contact:contact$user_id"
ret=`redis-cli -h $ip -p 6379 del $redis_key`
if [ $ret -ne 0 ];then
echo "删除redis缓存成功"
else
echo "删除redis缓存失败"
fi
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