|
|
@@ -202,54 +202,55 @@ class Lanqiupipeline(object):
|
|
|
for index, total_sizes_value in enumerate(value):
|
|
|
sole_str = 'TN' + str(key) + str(match_id) + 'hg3535'
|
|
|
sole = Helper.genearte_MD5(sole_str, pt)
|
|
|
- odds_str = 'TN' + str(key) + str(match_id) + 'hg3535' + str(
|
|
|
- total_sizes_dict_rule[key][index]) + str(total_sizes_value)
|
|
|
- odds_only = Helper.genearte_MD5(odds_str, pt)
|
|
|
+ # odds_str = 'TN' + str(key) + str(match_id) + 'hg3535' + str(
|
|
|
+ # total_sizes_dict_rule[key][index]) + str(total_sizes_value)
|
|
|
condition = str(total_sizes_dict_rule[key][index])
|
|
|
+ hash_str = "TN" + condition + '0' + '0' + str(total_sizes_value) + "hg3535" + str(match_id)
|
|
|
+ odds_only = Helper.genearte_MD5(hash_str, pt)
|
|
|
total_sizes_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
|
|
|
"condition", "odds_only", "sole", "source", "type", "team"]
|
|
|
total_sizes_value = [match_id, league_id, key, '0', index, 'TN', total_sizes_value, condition,
|
|
|
odds_only, sole, 'hg3535', '0', '']
|
|
|
total_sizes_data = dict(zip(total_sizes_key, total_sizes_value))
|
|
|
data_list.append(total_sizes_data)
|
|
|
- else:
|
|
|
- sole_str = 'TN' + str(key) + str(match_id) + 'hg3535'
|
|
|
- sole = Helper.genearte_MD5(sole_str, pt)
|
|
|
- odds_str = 'TN' + str(key) + str(match_id) + 'hg3535' + str(
|
|
|
- total_sizes_dict_rule[key]) + str(value)
|
|
|
- odds_only = Helper.genearte_MD5(odds_str, pt)
|
|
|
- condition = str(total_sizes_dict_rule[key])
|
|
|
- total_sizes_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
|
|
|
- "condition", "odds_only", "sole", "source", "type", "team"]
|
|
|
- total_sizes_value = [match_id, league_id, key, '0', 0, 'TN', value, condition,
|
|
|
- odds_only, sole, 'hg3535', '0', '']
|
|
|
- total_sizes_data = dict(zip(total_sizes_key, total_sizes_value))
|
|
|
- data_list.append(total_sizes_data)
|
|
|
+ # else:
|
|
|
+ # sole_str = "TN" + str(key) + '0' + str(match_id) + "hg3535"
|
|
|
+ # sole = Helper.genearte_MD5(sole_str, pt)
|
|
|
+ # condition = str(total_sizes_dict_rule[key])
|
|
|
+ # hash_str = "TN" + key + '0' + '0' + str(value) + "hg3535" + str(match_id)
|
|
|
+ # odds_only = Helper.genearte_MD5(hash_str, pt)
|
|
|
+ # total_sizes_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
|
|
|
+ # "condition", "odds_only", "sole", "source", "type", "team"]
|
|
|
+ # total_sizes_value = [match_id, league_id, key, '0', 0, 'TN', value, condition,
|
|
|
+ # odds_only, sole, 'hg3535', '0', '']
|
|
|
+ # total_sizes_data = dict(zip(total_sizes_key, total_sizes_value))
|
|
|
+ # data_list.append(total_sizes_data)
|
|
|
# 球队得分大小
|
|
|
if team_scores_dict:
|
|
|
for key, value in team_scores_dict.items():
|
|
|
- sole_str = 'TB' + str(key) + str(match_id) + 'hg3535'
|
|
|
- sole = Helper.genearte_MD5(sole_str, pt)
|
|
|
- odds_str = 'TB' + str(key) + str(match_id) + 'hg3535' + str(
|
|
|
- team_scores_dict_rule[key]) + str(value)
|
|
|
- odds_only = Helper.genearte_MD5(odds_str, pt)
|
|
|
- condition = str(team_scores_dict_rule[key])
|
|
|
- team_scores_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
|
|
|
- "condition", "odds_only", "sole", "source", "type", "team"]
|
|
|
- team_scores_value = [match_id, league_id, key, '0', 0, 'TB', value, condition,
|
|
|
- odds_only, sole, 'hg3535', '0', '']
|
|
|
- team_scores_data = dict(zip(team_scores_key, team_scores_value))
|
|
|
- data_list.append(team_scores_data)
|
|
|
+ if value:
|
|
|
+ for index, odd in enumerate(value):
|
|
|
+ sole_str = "TB" + str(key) + '0' + str(match_id) + "hg3535"
|
|
|
+ sole = Helper.genearte_MD5(sole_str, pt)
|
|
|
+ condition = str(team_scores_dict_rule[key][index])
|
|
|
+ hash_str = "TB" + key + str(index) + condition + str(odd) + "hg3535" + str(match_id)
|
|
|
+ odds_only = Helper.genearte_MD5(hash_str, pt)
|
|
|
+ team_scores_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
|
|
|
+ "condition", "odds_only", "sole", "source", "type", "team"]
|
|
|
+ team_scores_value = [match_id, league_id, key, '0', 0, 'TB', odd, condition,
|
|
|
+ odds_only, sole, 'hg3535', '0', '']
|
|
|
+ team_scores_data = dict(zip(team_scores_key, team_scores_value))
|
|
|
+ data_list.append(team_scores_data)
|
|
|
|
|
|
# 球队得分最后一位数
|
|
|
last_home_dict = {'0或5': 'lnh0', '1或6': 'lnh1', '2或7': 'lnh2', '3或8': 'lnh3', '4或9': 'lnh4'}
|
|
|
last_home = last_numbers_dict['last_home']
|
|
|
if last_home:
|
|
|
for key, value in last_home.items():
|
|
|
- sole_str = 'LN' + last_home_dict[key] + str(match_id) + 'hg3535'
|
|
|
+ sole_str = "LN" + last_home_dict[key] + '0' + str(match_id) + "hg3535"
|
|
|
sole = Helper.genearte_MD5(sole_str, pt)
|
|
|
- odds_str = 'LN' + last_home_dict[key] + str(match_id) + 'hg3535' + '0' + str(value)
|
|
|
- odds_only = Helper.genearte_MD5(odds_str, pt)
|
|
|
+ hash_str = "LN" + last_home_dict[key] + '0' + key + str(value) + "hg3535" + str(match_id)
|
|
|
+ odds_only = Helper.genearte_MD5(hash_str, pt)
|
|
|
last_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
|
|
|
"condition", "odds_only", "sole", "source", "type", "team"]
|
|
|
last_home_value = [match_id, league_id, last_home_dict[key], '0', 0, 'LN', value, key, odds_only, sole, 'hg3535', '0', '']
|
|
|
@@ -260,23 +261,23 @@ class Lanqiupipeline(object):
|
|
|
last_guest_dict = {'0或5': 'lng0', '1或6': 'lng1', '2或7': 'lng2', '3或8': 'lng3', '4或9': 'lng4'}
|
|
|
if last_guest:
|
|
|
for key, value in last_guest.items():
|
|
|
- sole_str = 'LN' + last_guest_dict[key] + str(match_id) + 'hg3535'
|
|
|
+ sole_str = "LN" + last_guest_dict[key] + '0' + str(match_id) + "hg3535"
|
|
|
sole = Helper.genearte_MD5(sole_str, pt)
|
|
|
- odds_str = 'LN' + last_guest_dict[key] + str(match_id) + 'hg3535' + '0' + str(value)
|
|
|
- odds_only = Helper.genearte_MD5(odds_str, pt)
|
|
|
+ hash_str = "LN" + last_guest_dict[key] + '0' + key + str(value) + "hg3535" + str(match_id)
|
|
|
+ odds_only = Helper.genearte_MD5(hash_str, pt)
|
|
|
last_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
|
|
|
"condition", "odds_only", "sole", "source", "type", "team"]
|
|
|
- last_guest_value = [match_id, league_id, key, '0', 0, 'LN', value, key, odds_only, sole, 'hg3535', '0', '']
|
|
|
+ last_guest_value = [match_id, league_id, last_guest_dict[key], '0', 0, 'LN', value, key, odds_only, sole, 'hg3535', '0', '']
|
|
|
last_guest_data = dict(zip(last_guest_key, last_guest_value))
|
|
|
data_list.append(last_guest_data)
|
|
|
|
|
|
# 独赢
|
|
|
if capots_dict:
|
|
|
for key, value in capots_dict.items():
|
|
|
- sole_str = 'C' + str(key) + str(match_id) + 'hg3535'
|
|
|
+ sole_str = "C" + str(key) + '0' + str(match_id) + "hg3535"
|
|
|
sole = Helper.genearte_MD5(sole_str, pt)
|
|
|
- odds_str = 'C' + str(key) + str(match_id) + 'hg3535' + str(value)
|
|
|
- odds_only = Helper.genearte_MD5(odds_str, pt)
|
|
|
+ hash_str = "C" + str(key) + '0' + str(key) + str(value) + "hg3535" + str(match_id)
|
|
|
+ odds_only = Helper.genearte_MD5(hash_str, pt)
|
|
|
capots_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
|
|
|
"condition", "odds_only", "sole", "source", "type", "team"]
|
|
|
capots_value = [match_id, league_id, key, '0', 0, 'C', value, '',
|