|
|
@@ -57,14 +57,20 @@ class RollPipeline(object):
|
|
|
json_key = 'zq_rollball'
|
|
|
match_list = []
|
|
|
match_identity = Helper.genearte_uuid(team_h + team_c + match_date)
|
|
|
+ ptype_id = match_all.get('ptype_id')
|
|
|
+ is_horn = 0
|
|
|
+ if ptype_id == '146':
|
|
|
+ ptype = match_all['ptype']
|
|
|
+ team_h = team_h.replace(ptype, '').strip()
|
|
|
+ team_c = team_c.replace(ptype, '').strip()
|
|
|
+ is_horn = 1
|
|
|
if self.db.zq_competition070.find({'match_id': match_id, 'is_rollball': 1}).count() < 1:
|
|
|
match_dict = {"game_code": "zq", "title": "match", "source": "hgg070"}
|
|
|
match_kay = ["home_team", "guest_team", "lg_id", "status", "match_id", "match_date", "match_time",
|
|
|
"tag", "source", "is_rollball", "is_morningplate", "is_stringscene", "us_time", "uuid",
|
|
|
"half_match_id", "is_today", "is_horn", 'match_identity']
|
|
|
match_value = [team_h, team_c, league_id, 0, match_id, match_date, match_time, tag_number,
|
|
|
- "hgg070", 1, 0, 0, us_time, uuid, 0, 0, 0,
|
|
|
- match_identity]
|
|
|
+ "hgg070", 1, 0, 0, us_time, uuid, 0, 0, is_horn, match_identity]
|
|
|
match_data = dict(zip(match_kay, match_value))
|
|
|
match_list.append(match_data)
|
|
|
match_dict['data'] = match_list
|
|
|
@@ -125,23 +131,30 @@ class RollPipeline(object):
|
|
|
logging.warning('足球详细赔率接口异常, {}'.format(res))
|
|
|
else:
|
|
|
logger.info('足球详细赔率列表为空')
|
|
|
- data_list = []
|
|
|
+ data_result = []
|
|
|
+ process = {"HT": "半场", "1H": "上半场", "2H": "下半场"}
|
|
|
+ match_process = process[re_time.split('^')[0]]
|
|
|
+ time_game = re_time.split('^')[1][:-1]
|
|
|
+ score_h = match_all.get('score_h')
|
|
|
+ score_c = match_all.get('score_c')
|
|
|
+ # all_goal = score_h + score_c
|
|
|
+ # match_score = '{}:{}'.format(score_h, score_c)
|
|
|
zq_rball = {"home_team": team_h, "guest_team": team_c,
|
|
|
"lg_id": league_id, "home_rate": 0,
|
|
|
- "guest_rate": 0, "home_score": score_home,
|
|
|
- "guest_score": score_guest, "all_goal": all_goal, "status": 1,
|
|
|
- "first_score": "", "last_score": "", "match_score": match_score, "uuid": uuid,
|
|
|
+ "guest_rate": 0, "home_score": score_h,
|
|
|
+ "guest_score": score_c, "all_goal": '', "status": 1,
|
|
|
+ "first_score": "", "last_score": "", "match_score": '', "uuid": uuid,
|
|
|
"match_winer": "", "match_time": time_game, 'match_identity': match_identity,
|
|
|
- "match_process": half_way, "tag": number,
|
|
|
+ "match_process": match_process, "tag": tag_number,
|
|
|
"match_id": match_id, "p_code": ""}
|
|
|
- data_list.append(zq_rball)
|
|
|
+ data_result.append(zq_rball)
|
|
|
r_data_dict = {
|
|
|
"game_code": "zq",
|
|
|
"title": "match_result_r",
|
|
|
- "source": "hg3535",
|
|
|
- "data": data_list
|
|
|
+ "source": "hgg070",
|
|
|
+ "data": data_result
|
|
|
}
|
|
|
- if data_list:
|
|
|
+ if data_result:
|
|
|
try:
|
|
|
res = Helper.async_post(MATCH_RESULT, r_data_dict)
|
|
|
if res:
|