Bladeren bron

250709-2代码。

baoyubo 1 maand geleden
bovenliggende
commit
3de2d51cc8
1 gewijzigde bestanden met toevoegingen van 5 en 5 verwijderingen
  1. 5 5
      routers/api/dutyManagement/schedule.py

+ 5 - 5
routers/api/dutyManagement/schedule.py

@@ -38,7 +38,7 @@ def user_id_get_duty_id(db,user_id_list):
 def duty_id_get_user_id(db,duty_id):
     query = db.query(DutyPersonnelArrangement)
     query = query.filter(DutyPersonnelArrangement.del_flag != '2')
-    query = query.filter(DutyPersonnelArrangement.id==duty_id)
+    query = query.filter(DutyPersonnelArrangement.duty_id==duty_id)
     data = query.all()
     return data
 
@@ -46,7 +46,7 @@ def user_id_get_info(db,user_id):
     query = db.query(EmergencyContactUser)
     query = query.filter(EmergencyContactUser.del_flag != '2')
     query = query.filter(EmergencyContactUser.id==user_id)
-    data = query.all()
+    data = query.first()
     return data
 
 @router.get('/list')
@@ -107,7 +107,7 @@ async def get_dict_data_by_type(
                                   "mobile_phone":contact_info.mobile_phone,
                                   "office_phone":contact_info.office_phone,
                                   "department_id":contact_info.department_id,
-                                  "yzy_userid":contact_info.yzy_userid})
+                                  "yzy_userid":contact_info.userid})
             data_list.append({
                 "id": d.id,
                 "start_time": d.start_time,
@@ -336,7 +336,7 @@ async def create_dict_data(
         db.refresh(new_duty_data)
         user_list = []
         for user_info in user_data:
-            user_list.appent( DutyPersonnelArrangement(
+            user_list.append( DutyPersonnelArrangement(
                 duty_id=new_duty_data.id,
                 position_id=user_info['position_id'],
                 personnel_id=user_info['personnel_id'],
@@ -389,7 +389,7 @@ async def updata_dict_type(
             })
         user_list = []
         for user_info in user_data:
-            user_list.appent(DutyPersonnelArrangement(
+            user_list.append(DutyPersonnelArrangement(
                 duty_id=duty_data.id,
                 position_id=user_info['position_id'],
                 personnel_id=user_info['personnel_id'],