Casper 6 months ago
parent
commit
087aca39cf
1 changed files with 12 additions and 4 deletions
  1. 12 4
      sri-server-bg01/api/v6/code3000.py

+ 12 - 4
sri-server-bg01/api/v6/code3000.py

@@ -39,14 +39,22 @@ async def code3001(**sources):
 
         # --- update ---
         item['uuid'] = uuid
+        item['start_time_at'] = item.get('start_at')
+        item['end_time_at'] = item.get('end_at')
+        item['cockpit_name'] = item.get('cockpit_id')
+        item['pid'] = item.get('vehicle_id')
         if len('67174cf9cd36d7a6def99cae') == len(item.get('user_uuid')):
-            item['user_name'] = Global.mdb.get_one_by_id('UserInfo', item.get('user_uuid')).get('name')
+            item['driver_name'] = Global.mdb.get_one_by_id('UserInfo', item.get('user_uuid')).get('name')
         else:
-            item['user_name'] = item.get('user_uuid')
-        item['start_time_at'] = item.get('')
-        # --- update --
+            item['driver_name'] = item.get('user_uuid')
 
+        # --- update --
         del item['_id']
+        del item['user_uuid']
+        del item['start_at']
+        del item['end_at']
+        del item['cockpit_id']
+        del item['vehicle_id']
         d1.append(item)
 
     # d1 = [