15954078560 2 lat temu
rodzic
commit
5cbc35c54a
1 zmienionych plików z 13 dodań i 11 usunięć
  1. 13 11
      application/common/controller/Api.php

+ 13 - 11
application/common/controller/Api.php

@@ -155,17 +155,19 @@ class Api
         $this->loadlang($controllername);
 
         //记录请求地址
-        $user_log = [
-            'user_id' => $this->auth->id ? :'',
-            'username' => $this->auth->mobile ? :'',
-            'url' => $modulename . '/' . $controllername . '/' . $actionname,
-            'content' => json_encode(request()->param('', null, 'trim,strip_tags,htmlspecialchars'), JSON_UNESCAPED_UNICODE),
-            'ip'        => request()->ip(),
-            'useragent' => substr(request()->server('HTTP_USER_AGENT'), 0, 255),
-            'createtime' => time()
-        ];
-
-        Db::name('user_log')->insert($user_log);
+        if ($controllername != 'notify') {
+            $user_log = [
+                'user_id' => $this->auth->id ?: '',
+                'username' => $this->auth->mobile ?: '',
+                'url' => $modulename . '/' . $controllername . '/' . $actionname,
+                'content' => json_encode(request()->param('', null, 'trim,strip_tags,htmlspecialchars'), JSON_UNESCAPED_UNICODE),
+                'ip' => request()->ip(),
+                'useragent' => substr(request()->server('HTTP_USER_AGENT'), 0, 255),
+                'createtime' => time()
+            ];
+
+            Db::name('user_log')->insert($user_log);
+        }
     }
 
     /**