diff --git a/dspt_api/util/api/seat_lock.py b/dspt_api/util/api/seat_lock.py index 27b8d4a..6d99545 100644 --- a/dspt_api/util/api/seat_lock.py +++ b/dspt_api/util/api/seat_lock.py @@ -20,11 +20,7 @@ class ApiSeatLock: if result_play and result_seat: play_data = random.choice(redis_data_play) seat_data = random.choice(redis_data_seat) - seat_id = '' - if isinstance(seat_data, dict): - seat_id = seat_data['cineSeatId'] - if isinstance(seat_data, list): - seat_id = ','.join([seat['cineSeatId'] for seat in seat_data]) + seat_id = ','.join([seat['cineSeatId'] for seat in seat_data]) return [{'param': 'play_id', 'value': play_data['id'], 'is_checked': True, 'result': True}, {'param': 'play_update_time', 'value': play_data['cineUpdateTime'], 'is_checked': True, 'result': True}, diff --git a/dspt_api/util/random_params.py b/dspt_api/util/random_params.py index 264d2ce..79ceffd 100644 --- a/dspt_api/util/random_params.py +++ b/dspt_api/util/random_params.py @@ -25,7 +25,10 @@ def random_params(_user_info, _handle_data): else: _user_data = _handle_data['res']['data'] if len(_user_data) > 0: - data['user_data'] = [random.choice(_user_data)] + if _user_info["api"] == 'play/seat-status': + data['user_data'] = [[random.choice(_user_data)]] + else: + data['user_data'] = [random.choice(_user_data)] redis_conn.set(redis_key_api, json.dumps(data)) else: redis_conn.delete(redis_key_api)