| | |
| | | pass |
| | | |
| | | @classmethod |
| | | def save_record(cls, day, records): |
| | | def save_record(cls, day, records, set_not_open=False): |
| | | """ |
| | | @param day: |
| | | @param records: |
| | | @param set_not_open: 是否需要设置炸板与否 |
| | | @return: |
| | | """ |
| | | # 统计炸板 |
| | | try: |
| | | last_codes = set() |
| | |
| | | mysqldb.execute( |
| | | f"update kpl_limit_up_record set _latest_limit_up_time='{d[3]}',_limit_up_time='{d[2]}',_hot_block_code_count={d[10]},_limit_up_high_info='{d[4]}' ,_update_time=now() where _id='{_id}'") |
| | | cls.latest_datas[_id] = d |
| | | if set_not_open: |
| | | # 需要设置不炸板 |
| | | mysqldb.execute(f"update kpl_limit_up_record set _open = 0, _update_time = now() where _id='{_id}'") |
| | | |
| | | cls.latest_datas[_id] = d |
| | | |
| | | # 获取原来的代码所属板块,删除之前错误的板块 |
| | |
| | | if lines: |
| | | if int(file[0].replace("-", "")) <= int(max_day.replace("-", "")): |
| | | fresults.append((file[0], json.loads(lines[0]))) |
| | | if len(fresults) >=count: |
| | | if len(fresults) >= count: |
| | | break |
| | | |
| | | return fresults |