wuggemail@foxmail.com 3 months ago
parent
commit
473aa7537a
3 changed files with 7 additions and 5 deletions
  1. 3 1
      app/user/controller/SystemLog.php
  2. 3 3
      app/user/model/SystemLog.php
  3. 1 1
      extend/SystemLog.php

+ 3 - 1
app/user/controller/SystemLog.php

@@ -23,7 +23,9 @@ class SystemLog extends Base{
             $where[]=['createTime','between',[$params['start'],$params['end']]];
         }
         $list = $this->model->where($where)->order('id desc')
-        ->paginate(["page"=>$params['page'],"list_rows"=>$params['size']]);
+        ->paginate(["page"=>$params['page'],"list_rows"=>$params['size']])->each(function($item,$key){
+                $item->action_msg = \SystemLog::GET_LOG_PATH($item->toArray(),$item->action_name,$item->param);
+            });
         return success("获取成功",["list"=>$list->items(),"count"=>$list->total()]);
     }
 }

+ 3 - 3
app/user/model/SystemLog.php

@@ -37,9 +37,9 @@ class SystemLog extends Base{
     protected $createTime = 'createTime';
     protected $append=['action_msg'];
 
-     public function getActionMsgAttr($value,$data){
-           return   \SystemLog::GET_LOG_PATH($data,$data['action_name'],json_decode($data['param'],true));
-    }
+//     public function getActionMsgAttr($value,$data){
+//           return   \SystemLog::GET_LOG_PATH($data,$data['action_name'],json_decode($data['param'],true));
+//    }
 
     public function getParamAttr($value){
                return   json_decode($value,true);

+ 1 - 1
extend/SystemLog.php

@@ -12,7 +12,7 @@ class SystemLog {
             if(!file_exists($file_path)){
                 throw new Exception("文件不存在");
             }
-             $data = include_once(self::$logPath.$file['system'].'/'.$file['controller'].'.php');
+             $data = include(self::$logPath.$file['system'].'/'.$file['controller'].'.php');
             return sprintf($data[$file['action']]['msg'],$system_uname,$param[$data[$file['action']]['resplace'][0]??0]??'');
         }catch (Exception $e){
             return "文件不存在";