Commit 011daeb1 by 岳巧源

push sku

parent c0064002
Showing with 33 additions and 0 deletions
# TODO push the data of liexin to go_nplm_server.
# 首先从234的redis中获取 supplier_id, brand_id的相关信息
# 根据获取到的信息去sku数据库中筛选 符合条件的数据信息(包含spu_id)
# 在redis中根据spu_id 获取到相关的分类信息等等。
# 映射组装后推送到 go_nplm_server处理
import json
import redis
db = redis.Redis(host='192.168.1.235', port=6379, password='icDb29mLy2s', decode_responses=True)
def get_channel_info():
"""return supplier_id 或者 brand_id 等等"""
data = {}
infos = db.hgetall('shop_distribution')
for i in range(len(infos)):
info_value = json.loads(infos[str(i+1)])
# 暂时只推京东数据
if info_value["shop_id"] != 1 or info_value["platform"] != 1:
continue
supplier_id_list = info_value["supplier_id_list"]
brand_id_list = info_value["brand_id_list"]
platform = info_value["platform"]
data["supplier_id_list"] = supplier_id_list
data["brand_id_list"] = brand_id_list
data["platform"] = platform
return data
if __name__ == '__main__':
get_channel_info()
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