Commit 3b87e05b by larosa

add test

parent 0ef48f57
Showing with 26 additions and 12 deletions
...@@ -18,7 +18,7 @@ def post_to_jd(): ...@@ -18,7 +18,7 @@ def post_to_jd():
"model": "MAC12DG-PRICE-LAROSA888", "model": "MAC12DG-PRICE-LAROSA888",
"cid1": 33556, "cid1": 33556,
# "leaf_cid": 33349, # "leaf_cid": 33349,
# "weight": 1, # 非盖亚必填 "weight": 1, # 非盖亚必填
"height": 1, # 非盖亚必填 "height": 1, # 非盖亚必填
"length": 1, # 非盖亚必填 "length": 1, # 非盖亚必填
"width": 1, # 非盖亚必填 "width": 1, # 非盖亚必填
...@@ -28,7 +28,7 @@ def post_to_jd(): ...@@ -28,7 +28,7 @@ def post_to_jd():
"item_num": "27348342899", "item_num": "27348342899",
"member_price": 1000.99, "member_price": 1000.99,
"market_price": 1100.99, "market_price": 1100.99,
"purchase_price": 900.0000, "purchase_price": 900.0001,
"saler_code": "gonglingzhe1", "saler_code": "gonglingzhe1",
"purchaser_code": "gonglingzhe1", "purchaser_code": "gonglingzhe1",
"prop_id": "232935,232969,232953,232988,274281,270354", # 属性id "prop_id": "232935,232969,232953,232988,274281,270354", # 属性id
...@@ -43,13 +43,10 @@ def post_to_jd(): ...@@ -43,13 +43,10 @@ def post_to_jd():
"intro_html": "<img src=https://img30.360buyimg.com/sku/jfs/t1/133800/28/25551/94742/62fef403E1a77f3a2/9b92597c0c26d1c8.jpg' /><br>", # pc商详 "intro_html": "<img src=https://img30.360buyimg.com/sku/jfs/t1/133800/28/25551/94742/62fef403E1a77f3a2/9b92597c0c26d1c8.jpg' /><br>", # pc商详
"intro_mobile": "<img src=https://img30.360buyimg.com/sku/jfs/t1/133800/28/25551/94742/62fef403E1a77f3a2/9b92597c0c26d1c8.jpg' /><br>", # 移动商详 "intro_mobile": "<img src=https://img30.360buyimg.com/sku/jfs/t1/133800/28/25551/94742/62fef403E1a77f3a2/9b92597c0c26d1c8.jpg' /><br>", # 移动商详
} }
# ans = request_to_jd_vc(method_name=methodName, token=token, app_key=app_key, app_secret=app_secret, param=param) ans = request_to_jd_vc(method_name=methodName, token=token, app_key=app_key, app_secret=app_secret, param=param)
# print(json.dumps(ans, ensure_ascii=False)) print(json.dumps(ans, ensure_ascii=False))
ans_s = json.dumps(param, ensure_ascii=False)
print(ans_s)
if __name__ == '__main__': if __name__ == '__main__':
ans = format_to_four_decimals(9.678) post_to_jd()
print(ans) \ No newline at end of file
sql = "select select goods_id, spu_id, supplier_id from "
\ No newline at end of file
...@@ -65,6 +65,23 @@ def main(): ...@@ -65,6 +65,23 @@ def main():
print(update_sql % (default_unit, id)) print(update_sql % (default_unit, id))
db.commit() db.commit()
def modify_apply_id_map():
"""将map转字符串"""
conf = config_dev
db = pymysql.connect(host=conf["mysql"]["host"], port=conf["mysql"]["port"], user=conf["mysql"]["user"], password=conf["mysql"]["password"], database=conf["mysql"]["database"])
cursor = db.cursor()
select_sql = "select id, apply_id from lie_shop_push_sku_log where apply_id != ''"
cursor.execute(query=select_sql)
db_result = cursor.fetchall()
for i in range(len(db_result)):
id = db_result[i][0]
apply_id_str = str(db_result[i][1])
ans = json.loads(apply_id_str)
apply_id = ans["productApplyId"]
update_sql = "update lie_shop_push_sku_log set apply_id = %s where id = %s"
cursor.execute(query=update_sql, args=(apply_id, id,))
db.commit()
print(update_sql % (apply_id, id))
if __name__ == '__main__': if __name__ == '__main__':
main() modify_apply_id_map()
\ No newline at end of file \ No newline at end of file
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 sign in to comment