ソースを参照

隐患标准库

xuguoyang 5 ヶ月 前
コミット
c71eb01edf
1 ファイル変更2 行追加1 行削除
  1. 2 1
      routers/api/hazardStandards/__init__.py

+ 2 - 1
routers/api/hazardStandards/__init__.py

@@ -13,7 +13,7 @@ import uuid
 from utils import *
 from common.security import valid_access_token
 import traceback
-from sqlalchemy import text, exists
+from sqlalchemy import text, exists,desc
 router = APIRouter()
 
 def get_next_yjbh_id(db: Session):
@@ -153,6 +153,7 @@ async def select_files(
         if standard_type:
             data_query = data_query.filter(HazardStandardsFile.standard_type == standard_type)
 
+        data_query = data_query.order_by(desc(HazardStandardsFile.create_time))
         # # 应用排序条件
         # if sortBy:
         #     if hasattr(HazardStandardsFile, sortBy):