diff --git a/app/cross_evaluate_worker.py b/app/cross_evaluate_worker.py index 33ce528..5ea1594 100644 --- a/app/cross_evaluate_worker.py +++ b/app/cross_evaluate_worker.py @@ -43,7 +43,7 @@ def query_cross_list(params): "09:00-17:00", "17:00-19:00", "19:00-22:00", - "22:00-00:00" + "22:00-23:59" ] peak_tp = [ "07:00-09:00", diff --git a/app/tmnet_db_func.py b/app/tmnet_db_func.py index 77ffe62..a5c63a2 100644 --- a/app/tmnet_db_func.py +++ b/app/tmnet_db_func.py @@ -67,7 +67,13 @@ class TmnetDbHelper(TableDbHelperBase): from (select name,crossid, location,nodeid, area_id from `cross` where nodeid = %s and area_id = %s and at_edge=0 and isdeleted=0 ) as t1 left join (select name,crossid, location,nodeid, area_id from `cross_ledger_update_info` where nodeid = %s and area_id = %s and at_edge=0 and isdeleted=0 ) as t2 on t1.crossid=t2.crossid """ % (nodeid, area_id, nodeid, area_id) - return self.do_select(sql) + cross_list = self.do_select(sql) + if area_id != 0: + area_cross_sql = f'select * from bound_crosses where nodeid = {nodeid} and area_id = {area_id}' + area_crosses = self.do_select(area_cross_sql) + area_cross_list = [cross['crossid'] for cross in area_crosses] + cross_list = [cross for cross in cross_list if cross['crossid'] in area_cross_list] + return cross_list def query_cross_inroads(self, crossid, nodeid): sql = """