chenjunkai 7 years ago
parent
commit
82954c7622
1 changed files with 8 additions and 2 deletions
  1. 8 2
      Controller/AccessLog.py

+ 8 - 2
Controller/AccessLog.py

@@ -104,8 +104,14 @@ class AccessLog(View):
             if check_perm is True:
             if check_perm is True:
                 try:
                 try:
                     content = json.loads(content)
                     content = json.loads(content)
-                    search_kwargs = CommonService.get_kwargs(data=content)
-                    queryset = Access_Log.objects.filter(**search_kwargs).order_by(order)
+                    kwargs = {}
+                    for (k, v) in content.items():
+                        if v is not None and v != u'':
+                            if k == 'content':
+                                kwargs[k + '__icontains'] = v
+                            else:
+                                kwargs[k] = v
+                    queryset = Access_Log.objects.filter(**kwargs).order_by(order)
                 except Exception as e:
                 except Exception as e:
                     return response.json(444)
                     return response.json(444)
                 if starttime is not None and starttime != '' and endtime is not None and endtime != '':
                 if starttime is not None and starttime != '' and endtime is not None and endtime != '':