| 
														
															@@ -34,7 +34,7 @@ def prepare_raw_data(dt_begin, dt_end): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     sql = f""" 
														 | 
														
														 | 
														
															     sql = f""" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         SELECT {fields_str} FROM datastat_score WHERE dt BETWEEN {dt_begin} AND {dt_end} 
														 | 
														
														 | 
														
															         SELECT {fields_str} FROM datastat_score WHERE dt BETWEEN {dt_begin} AND {dt_end} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             AND similarity > 0 AND category IS NOT NULL AND read_avg > 500 
														 | 
														
														 | 
														
															             AND similarity > 0 AND category IS NOT NULL AND read_avg > 500 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            AND read_avg_rate BETWEEN 0 AND 3 AND view_count_rate > 0 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            AND read_avg_rate BETWEEN 0.3 AND 3 AND view_count_rate > 0 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             AND `index` in (1, 2) 
														 | 
														
														 | 
														
															             AND `index` in (1, 2) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             AND (FROM_UNIXTIME(coalesce(publish_timestamp, 0), '%H') < '15' 
														 | 
														
														 | 
														
															             AND (FROM_UNIXTIME(coalesce(publish_timestamp, 0), '%H') < '15' 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 OR gh_id in {night_accounts_condition}) 
														 | 
														
														 | 
														
															                 OR gh_id in {night_accounts_condition}) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -54,7 +54,7 @@ def clear_old_version(db_manager, dt): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         WHERE dt < {dt} and status = 1 
														 | 
														
														 | 
														
															         WHERE dt < {dt} and status = 1 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     """ 
														 | 
														
														 | 
														
															     """ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     rows = db_manager.execute(sql) 
														 | 
														
														 | 
														
															     rows = db_manager.execute(sql) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    print(f"updated rows: {rows}") 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    print(f"updated rows for clear: {rows}") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 def get_last_version(db_manager, dt): 
														 | 
														
														 | 
														
															 def get_last_version(db_manager, dt): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     sql = f""" 
														 | 
														
														 | 
														
															     sql = f""" 
														 |