Procházet zdrojové kódy

修改存储日志内容

durong před 5 roky
rodič
revize
fe2e95cd67

+ 9 - 3
app/Repositories/Behavior/BehaviorRepository.php

@@ -177,7 +177,7 @@ class BehaviorRepository
                     'operator_id' => $uid,
                     'behavior_id' => $res['id'],
                     'username' => $username,
-                    'content' => json_encode($data),
+                    'content' => '创建'.$request['name'].'行为',
                     'type' => 0,
                     'created_at' => date('Y-m-d H:i:s'),
                     'updated_at' => date('Y-m-d H:i:s')
@@ -271,6 +271,12 @@ class BehaviorRepository
             'is_open' => $request['is_open'],
             'updated_at' => date('Y-m-d H:i:s')
         ];
+        if ($request['is_open'] == 0){
+            $is_open = '关闭';
+        }else{
+            $is_open = '开启';
+        }
+        $behavior_name = $behavior->name;
 
         DB::beginTransaction();
         try {
@@ -283,8 +289,8 @@ class BehaviorRepository
                     'operator_id' => $uid,
                     'behavior_id' => $request['id'],
                     'username' => $username,
-                    'content' => json_encode($behavior_array),
-                    'type' => 1,
+                    'content' => $is_open.'了'.$behavior_name.'行为',
+                    'type' => 2,
                     'created_at' => date('Y-m-d H:i:s'),
                     'updated_at' => date('Y-m-d H:i:s')
                 ];