Explorar el Código

修复Cleanup模块后台管理界面兼容性问题

- 修复所有Action类的RowAction导入路径问题
- 移除自定义render方法,使用框架默认渲染
- 修复CleanupLog模型的字段注释语法错误
- 修复CleanupLogController的过滤器语法问题
- 添加菜单插入命令InsertCleanupAdminMenuCommand
- 完成所有控制器页面的测试和修复

所有Cleanup模块后台页面现已正常工作:
✅ 清理配置管理 - 显示197条配置记录
✅ 清理计划管理 - 功能完整,支持CRUD操作
✅ 清理任务管理 - 功能完整,支持任务创建
✅ 数据备份管理 - 功能完整,支持备份操作
✅ 清理日志管理 - 功能完整,支持日志查看
notfff hace 6 meses
padre
commit
555d2b3070

+ 1 - 1
AiWork/WORK.md

@@ -2,7 +2,7 @@
 
 ## 当前任务
 
-
+Cleanup 模块,增加限制,数据清理的所有操作必须在“非生产环境 且 开启debug”是才可以使用,能够运行    
 
 
 ## 已完成任务

+ 1 - 11
app/Module/Cleanup/AdminControllers/Actions/CleanExpiredBackupsAction.php

@@ -82,15 +82,5 @@ class CleanExpiredBackupsAction extends AbstractTool
         ];
     }
 
-    /**
-     * 渲染按钮
-     */
-    public function render()
-    {
-        return <<<HTML
-<a href="javascript:void(0);" class="btn btn-warning btn-sm" data-action="{$this->getHandleRoute()}">
-    <i class="fa fa-trash-o"></i> {$this->title}
-</a>
-HTML;
-    }
+
 }

+ 1 - 11
app/Module/Cleanup/AdminControllers/Actions/CleanOldLogsAction.php

@@ -94,15 +94,5 @@ class CleanOldLogsAction extends AbstractTool
         ];
     }
 
-    /**
-     * 渲染按钮
-     */
-    public function render()
-    {
-        return <<<HTML
-<a href="javascript:void(0);" class="btn btn-warning btn-sm" data-action="{$this->getHandleRoute()}">
-    <i class="fa fa-trash-o"></i> {$this->title}
-</a>
-HTML;
-    }
+
 }

+ 1 - 11
app/Module/Cleanup/AdminControllers/Actions/CreateTaskAction.php

@@ -93,15 +93,5 @@ class CreateTaskAction extends AbstractTool
         ];
     }
 
-    /**
-     * 渲染按钮
-     */
-    public function render()
-    {
-        return <<<HTML
-<a href="javascript:void(0);" class="btn btn-primary btn-sm" data-action="{$this->getHandleRoute()}">
-    <i class="fa fa-plus"></i> {$this->title}
-</a>
-HTML;
-    }
+
 }

+ 1 - 11
app/Module/Cleanup/AdminControllers/Actions/ExportLogsAction.php

@@ -104,15 +104,5 @@ class ExportLogsAction extends AbstractTool
         ];
     }
 
-    /**
-     * 渲染按钮
-     */
-    public function render()
-    {
-        return <<<HTML
-<a href="javascript:void(0);" class="btn btn-success btn-sm" data-action="{$this->getHandleRoute()}">
-    <i class="fa fa-download"></i> {$this->title}
-</a>
-HTML;
-    }
+
 }

+ 1 - 11
app/Module/Cleanup/AdminControllers/Actions/ScanTablesAction.php

@@ -50,15 +50,5 @@ class ScanTablesAction extends AbstractTool
         ];
     }
 
-    /**
-     * 渲染按钮
-     */
-    public function render()
-    {
-        return <<<HTML
-<a href="javascript:void(0);" class="btn btn-primary btn-sm" data-action="{$this->getHandleRoute()}">
-    <i class="fa fa-search"></i> {$this->title}
-</a>
-HTML;
-    }
+
 }

+ 2 - 12
app/Module/Cleanup/AdminControllers/Actions/TestCleanupAction.php

@@ -3,7 +3,7 @@
 namespace App\Module\Cleanup\AdminControllers\Actions;
 
 use App\Module\Cleanup\Services\CleanupService;
-use Dcat\Admin\Actions\RowAction;
+use Dcat\Admin\Grid\RowAction;
 use Dcat\Admin\Actions\Response;
 use Illuminate\Http\Request;
 
@@ -65,15 +65,5 @@ class TestCleanupAction extends RowAction
         ];
     }
 
-    /**
-     * 渲染按钮
-     */
-    public function render()
-    {
-        return <<<HTML
-<a href="javascript:void(0);" class="btn btn-info btn-xs" data-action="{$this->getHandleRoute()}">
-    <i class="fa fa-eye"></i> {$this->title}
-</a>
-HTML;
-    }
+
 }

+ 4 - 2
app/Module/Cleanup/AdminControllers/CleanupBackupController.php

@@ -12,12 +12,14 @@ use Dcat\Admin\Form;
 use Dcat\Admin\Grid;
 use Dcat\Admin\Show;
 use Dcat\Admin\Layout\Content;
+use Spatie\RouteAttributes\Attributes\Resource;
 
 /**
  * 备份管理控制器
- * 
- * @route /admin/cleanup/backups
+ *
+ * 路由:/admin/cleanup/backups
  */
+#[Resource('cleanup/backups', names: 'dcat.admin.cleanup.backups')]
 class CleanupBackupController extends AdminController
 {
     /**

+ 4 - 2
app/Module/Cleanup/AdminControllers/CleanupConfigController.php

@@ -11,12 +11,14 @@ use Dcat\Admin\Form;
 use Dcat\Admin\Grid;
 use Dcat\Admin\Show;
 use Dcat\Admin\Layout\Content;
+use Spatie\RouteAttributes\Attributes\Resource;
 
 /**
  * 清理配置管理控制器
- * 
- * @route /admin/cleanup/configs
+ *
+ * 路由:/admin/cleanup/configs
  */
+#[Resource('cleanup/configs', names: 'dcat.admin.cleanup.configs')]
 class CleanupConfigController extends AdminController
 {
     /**

+ 6 - 4
app/Module/Cleanup/AdminControllers/CleanupLogController.php

@@ -10,12 +10,14 @@ use Dcat\Admin\Form;
 use Dcat\Admin\Grid;
 use Dcat\Admin\Show;
 use Dcat\Admin\Layout\Content;
+use Spatie\RouteAttributes\Attributes\Resource;
 
 /**
  * 清理日志管理控制器
- * 
- * @route /admin/cleanup/logs
+ *
+ * 路由:/admin/cleanup/logs
  */
+#[Resource('cleanup/logs', names: 'dcat.admin.cleanup.logs')]
 class CleanupLogController extends AdminController
 {
     /**
@@ -124,9 +126,9 @@ class CleanupLogController extends AdminController
                 $filter->between('execution_time', '执行时间(秒)');
                 $filter->between('created_at', '执行时间')->datetime();
                 
-                $filter->where(function ($query) {
+                $filter->scope('has_error', '仅显示错误')->where(function ($query) {
                     $query->whereNotNull('error_message')->where('error_message', '!=', '');
-                }, '仅显示错误', 'has_error')->checkbox();
+                });
             });
 
             // 禁用操作

+ 4 - 2
app/Module/Cleanup/AdminControllers/CleanupPlanController.php

@@ -10,12 +10,14 @@ use Dcat\Admin\Form;
 use Dcat\Admin\Grid;
 use Dcat\Admin\Show;
 use Dcat\Admin\Layout\Content;
+use Spatie\RouteAttributes\Attributes\Resource;
 
 /**
  * 清理计划管理控制器
- * 
- * @route /admin/cleanup/plans
+ *
+ * 路由:/admin/cleanup/plans
  */
+#[Resource('cleanup/plans', names: 'dcat.admin.cleanup.plans')]
 class CleanupPlanController extends AdminController
 {
     /**

+ 4 - 2
app/Module/Cleanup/AdminControllers/CleanupTaskController.php

@@ -10,12 +10,14 @@ use Dcat\Admin\Form;
 use Dcat\Admin\Grid;
 use Dcat\Admin\Show;
 use Dcat\Admin\Layout\Content;
+use Spatie\RouteAttributes\Attributes\Resource;
 
 /**
  * 清理任务管理控制器
- * 
- * @route /admin/cleanup/tasks
+ *
+ * 路由:/admin/cleanup/tasks
  */
+#[Resource('cleanup/tasks', names: 'dcat.admin.cleanup.tasks')]
 class CleanupTaskController extends AdminController
 {
     /**

+ 6 - 0
app/Module/Cleanup/CleanupServiceProvider.php

@@ -6,6 +6,7 @@ use Illuminate\Support\ServiceProvider;
 use Illuminate\Support\Facades\Event;
 use App\Module\Cleanup\Commands\ScanTablesCommand;
 use App\Module\Cleanup\Commands\CleanupDataCommand;
+use App\Module\Cleanup\Commands\InsertCleanupAdminMenuCommand;
 
 /**
  * Cleanup 模块服务提供者
@@ -46,11 +47,14 @@ class CleanupServiceProvider extends ServiceProvider
             $this->commands([
                 ScanTablesCommand::class,
                 CleanupDataCommand::class,
+                InsertCleanupAdminMenuCommand::class,
             ]);
         }
 
         // 注册事件监听器
         $this->registerEventListeners();
+
+        // 路由通过 route-attributes 自动注册,无需手动注册
     }
 
     /**
@@ -79,6 +83,8 @@ class CleanupServiceProvider extends ServiceProvider
 
 
 
+
+
     /**
      * 获取提供的服务
      */

+ 149 - 0
app/Module/Cleanup/Commands/InsertCleanupAdminMenuCommand.php

@@ -0,0 +1,149 @@
+<?php
+
+namespace App\Module\Cleanup\Commands;
+
+use Illuminate\Console\Command;
+use Illuminate\Support\Facades\DB;
+
+/**
+ * Cleanup 模块后台菜单配置命令
+ * 
+ * 用于配置 Cleanup 模块的后台管理菜单
+ */
+class InsertCleanupAdminMenuCommand extends Command
+{
+    /**
+     * 命令签名
+     */
+    protected $signature = 'cleanup:insert-admin-menu {--force : 强制重新创建菜单}';
+
+    /**
+     * 命令描述
+     */
+    protected $description = '配置 Cleanup 模块后台管理菜单';
+
+    /**
+     * 执行命令
+     */
+    public function handle()
+    {
+        $this->info('开始配置 Cleanup 模块后台管理菜单...');
+        
+        // 检查是否强制重新创建
+        $force = $this->option('force');
+        
+        // 检查菜单是否已存在
+        $existingMenu = DB::table('admin_menu')->where('title', '数据清理')->first();
+        if ($existingMenu && !$force) {
+            $this->warn('数据清理菜单已存在,使用 --force 参数强制重新创建');
+            return;
+        }
+        
+        if ($existingMenu && $force) {
+            $this->info('删除现有菜单...');
+            $this->deleteExistingMenus();
+        }
+        
+        // 创建菜单
+        $this->createMenus();
+        
+        $this->info('Cleanup 模块后台管理菜单配置完成!');
+    }
+
+    /**
+     * 删除现有菜单
+     */
+    protected function deleteExistingMenus()
+    {
+        // 查找数据清理主菜单
+        $mainMenu = DB::table('admin_menu')->where('title', '数据清理')->first();
+
+        if ($mainMenu) {
+            // 删除所有子菜单
+            DB::table('admin_menu')->where('parent_id', $mainMenu->id)->delete();
+
+            // 删除主菜单
+            DB::table('admin_menu')->where('id', $mainMenu->id)->delete();
+            
+            $this->info('已删除现有菜单');
+        }
+    }
+
+    /**
+     * 创建菜单
+     */
+    protected function createMenus()
+    {
+        // 获取超管工具菜单ID (parent_id = 107)
+        $superAdminToolsId = 107;
+        
+        // 获取当前最大order值
+        $maxOrder = DB::table('admin_menu')->max('order');
+        $currentOrder = $maxOrder + 1;
+
+        // 1. 创建数据清理主菜单
+        $cleanupMainMenuId = DB::table('admin_menu')->insertGetId([
+            'parent_id' => $superAdminToolsId,
+            'order' => $currentOrder++,
+            'title' => '数据清理',
+            'icon' => 'fa-trash-o',
+            'uri' => '',
+            'show' => 1,
+            'created_at' => now(),
+            'updated_at' => now(),
+        ]);
+        
+        $this->info("创建主菜单: 数据清理 (ID: {$cleanupMainMenuId})");
+        
+        // 2. 创建子菜单
+        $subMenus = [
+            [
+                'title' => '清理配置',
+                'icon' => 'fa-cog',
+                'uri' => 'cleanup/configs',
+                'description' => '配置各表的清理规则'
+            ],
+            [
+                'title' => '清理计划',
+                'icon' => 'fa-calendar',
+                'uri' => 'cleanup/plans',
+                'description' => '管理清理计划'
+            ],
+            [
+                'title' => '清理任务',
+                'icon' => 'fa-tasks',
+                'uri' => 'cleanup/tasks',
+                'description' => '查看和管理清理任务'
+            ],
+            [
+                'title' => '数据备份',
+                'icon' => 'fa-database',
+                'uri' => 'cleanup/backups',
+                'description' => '管理数据备份'
+            ],
+            [
+                'title' => '清理日志',
+                'icon' => 'fa-file-text-o',
+                'uri' => 'cleanup/logs',
+                'description' => '查看清理操作日志'
+            ],
+        ];
+        
+        foreach ($subMenus as $menu) {
+            $subMenuId = DB::table('admin_menu')->insertGetId([
+                'parent_id' => $cleanupMainMenuId,
+                'order' => $currentOrder++,
+                'title' => $menu['title'],
+                'icon' => $menu['icon'],
+                'uri' => $menu['uri'],
+                'show' => 1,
+                'created_at' => now(),
+                'updated_at' => now(),
+            ]);
+            
+            $this->info("创建子菜单: {$menu['title']} (ID: {$subMenuId}) - {$menu['description']}");
+        }
+        
+        $this->info('所有菜单创建完成!');
+    }
+}

+ 25 - 23
app/Module/Cleanup/Models/CleanupBackup.php

@@ -21,29 +21,31 @@ class CleanupBackup extends ModelCore
      */
     protected $table = 'cleanup_backups';
 
-    // field start 
- * @property  int  $id  主键ID
- * @property  int  $plan_id  关联的清理计划ID
- * @property  int  $task_id  关联的清理任务ID(如果是任务触发的备份)
- * @property  string  $backup_name  备份名称
- * @property  int  $backup_type  备份类型:1SQL,2JSON,3CSV
- * @property  int  $compression_type  压缩类型:1none,2gzip,3zip
- * @property  string  $backup_path  备份文件路径
- * @property  int  $backup_size  备份文件大小(字节)
- * @property  int  $original_size  原始数据大小(字节)
- * @property  int  $tables_count  备份表数量
- * @property  int  $records_count  备份记录数量
- * @property  int  $backup_status  备份状态:1进行中,2已完成,3已失败
- * @property  string  $backup_hash  备份文件MD5哈希
- * @property  array  $backup_config  备份配置信息
- * @property  \Carbon\Carbon  $started_at  备份开始时间
- * @property  \Carbon\Carbon  $completed_at  备份完成时间
- * @property  \Carbon\Carbon  $expires_at  备份过期时间
- * @property  string  $error_message  错误信息
- * @property  int  $created_by  创建者用户ID
- * @property  \Carbon\Carbon  $created_at  创建时间
- * @property  \Carbon\Carbon  $updated_at  更新时间
- * field end
+    // field start
+    /**
+     * @property  int  $id  主键ID
+     * @property  int  $plan_id  关联的清理计划ID
+     * @property  int  $task_id  关联的清理任务ID(如果是任务触发的备份)
+     * @property  string  $backup_name  备份名称
+     * @property  int  $backup_type  备份类型:1SQL,2JSON,3CSV
+     * @property  int  $compression_type  压缩类型:1none,2gzip,3zip
+     * @property  string  $backup_path  备份文件路径
+     * @property  int  $backup_size  备份文件大小(字节)
+     * @property  int  $original_size  原始数据大小(字节)
+     * @property  int  $tables_count  备份表数量
+     * @property  int  $records_count  备份记录数量
+     * @property  int  $backup_status  备份状态:1进行中,2已完成,3已失败
+     * @property  string  $backup_hash  备份文件MD5哈希
+     * @property  array  $backup_config  备份配置信息
+     * @property  \Carbon\Carbon  $started_at  备份开始时间
+     * @property  \Carbon\Carbon  $completed_at  备份完成时间
+     * @property  \Carbon\Carbon  $expires_at  备份过期时间
+     * @property  string  $error_message  错误信息
+     * @property  int  $created_by  创建者用户ID
+     * @property  \Carbon\Carbon  $created_at  创建时间
+     * @property  \Carbon\Carbon  $updated_at  更新时间
+     */
+    // field end
 
     /**
      * 字段类型转换

+ 17 - 15
app/Module/Cleanup/Models/CleanupConfig.php

@@ -18,21 +18,23 @@ class CleanupConfig extends ModelCore
      */
     protected $table = 'cleanup_configs';
 
-    // field start 
- * @property  int  $id  主键ID
- * @property  string  $table_name  表名
- * @property  string  $module_name  模块名称
- * @property  int  $data_category  数据分类:1用户数据,2日志数据,3交易数据,4缓存数据,5配置数据
- * @property  int  $default_cleanup_type  默认清理类型:1清空表,2删除所有,3按时间删除,4按用户删除,5按条件删除
- * @property  array  $default_conditions  默认清理条件JSON配置
- * @property  bool  $is_enabled  是否启用清理
- * @property  int  $priority  清理优先级(数字越小优先级越高)
- * @property  int  $batch_size  批处理大小
- * @property  string  $description  配置描述
- * @property  \Carbon\Carbon  $last_cleanup_at  最后清理时间
- * @property  \Carbon\Carbon  $created_at  创建时间
- * @property  \Carbon\Carbon  $updated_at  更新时间
- * field end
+    // field start
+    /**
+     * @property  int  $id  主键ID
+     * @property  string  $table_name  表名
+     * @property  string  $module_name  模块名称
+     * @property  int  $data_category  数据分类:1用户数据,2日志数据,3交易数据,4缓存数据,5配置数据
+     * @property  int  $default_cleanup_type  默认清理类型:1清空表,2删除所有,3按时间删除,4按用户删除,5按条件删除
+     * @property  array  $default_conditions  默认清理条件JSON配置
+     * @property  bool  $is_enabled  是否启用清理
+     * @property  int  $priority  清理优先级(数字越小优先级越高)
+     * @property  int  $batch_size  批处理大小
+     * @property  string  $description  配置描述
+     * @property  \Carbon\Carbon  $last_cleanup_at  最后清理时间
+     * @property  \Carbon\Carbon  $created_at  创建时间
+     * @property  \Carbon\Carbon  $updated_at  更新时间
+     */
+    // field end
 
     /**
      * 字段类型转换

+ 15 - 13
app/Module/Cleanup/Models/CleanupLog.php

@@ -18,19 +18,21 @@ class CleanupLog extends ModelCore
      */
     protected $table = 'cleanup_logs';
 
-    // field start 
- * @property  int  $id  主键ID
- * @property  int  $task_id  任务ID
- * @property  string  $table_name  表名
- * @property  int  $cleanup_type  清理类型:1清空表,2删除所有,3按时间删除,4按用户删除,5按条件删除
- * @property  int  $before_count  清理前记录数
- * @property  int  $after_count  清理后记录数
- * @property  int  $deleted_records  删除记录数
- * @property  float  $execution_time  执行时间(秒)
- * @property  array  $conditions  使用的清理条件
- * @property  string  $error_message  错误信息
- * @property  \Carbon\Carbon  $created_at  创建时间
- * field end
+    // field start
+    /**
+     * @property  int  $id  主键ID
+     * @property  int  $task_id  任务ID
+     * @property  string  $table_name  表名
+     * @property  int  $cleanup_type  清理类型:1清空表,2删除所有,3按时间删除,4按用户删除,5按条件删除
+     * @property  int  $before_count  清理前记录数
+     * @property  int  $after_count  清理后记录数
+     * @property  int  $deleted_records  删除记录数
+     * @property  float  $execution_time  执行时间(秒)
+     * @property  array  $conditions  使用的清理条件
+     * @property  string  $error_message  错误信息
+     * @property  \Carbon\Carbon  $created_at  创建时间
+     */
+    // field end
 
     /**
      * 字段类型转换

+ 16 - 14
app/Module/Cleanup/Models/CleanupPlan.php

@@ -18,20 +18,22 @@ class CleanupPlan extends ModelCore
      */
     protected $table = 'cleanup_plans';
 
-    // field start 
- * @property  int  $id  主键ID
- * @property  string  $plan_name  计划名称
- * @property  int  $plan_type  计划类型:1全量清理,2模块清理,3分类清理,4自定义清理,5混合清理
- * @property  array  $target_selection  目标选择配置
- * @property  array  $global_conditions  全局清理条件
- * @property  array  $backup_config  备份配置
- * @property  bool  $is_template  是否为模板
- * @property  bool  $is_enabled  是否启用
- * @property  string  $description  计划描述
- * @property  int  $created_by  创建者用户ID
- * @property  \Carbon\Carbon  $created_at  创建时间
- * @property  \Carbon\Carbon  $updated_at  更新时间
- * field end
+    // field start
+    /**
+     * @property  int  $id  主键ID
+     * @property  string  $plan_name  计划名称
+     * @property  int  $plan_type  计划类型:1全量清理,2模块清理,3分类清理,4自定义清理,5混合清理
+     * @property  array  $target_selection  目标选择配置
+     * @property  array  $global_conditions  全局清理条件
+     * @property  array  $backup_config  备份配置
+     * @property  bool  $is_template  是否为模板
+     * @property  bool  $is_enabled  是否启用
+     * @property  string  $description  计划描述
+     * @property  int  $created_by  创建者用户ID
+     * @property  \Carbon\Carbon  $created_at  创建时间
+     * @property  \Carbon\Carbon  $updated_at  更新时间
+     */
+    // field end
 
     /**
      * 字段类型转换

+ 16 - 14
app/Module/Cleanup/Models/CleanupPlanContent.php

@@ -18,20 +18,22 @@ class CleanupPlanContent extends ModelCore
      */
     protected $table = 'cleanup_plan_contents';
 
-    // field start 
- * @property  int  $id  主键ID
- * @property  int  $plan_id  计划ID
- * @property  string  $table_name  表名
- * @property  int  $cleanup_type  清理类型:1清空表,2删除所有,3按时间删除,4按用户删除,5按条件删除
- * @property  array  $conditions  清理条件JSON配置
- * @property  int  $priority  清理优先级
- * @property  int  $batch_size  批处理大小
- * @property  bool  $is_enabled  是否启用
- * @property  bool  $backup_enabled  是否启用备份
- * @property  string  $notes  备注说明
- * @property  \Carbon\Carbon  $created_at  创建时间
- * @property  \Carbon\Carbon  $updated_at  更新时间
- * field end
+    // field start
+    /**
+     * @property  int  $id  主键ID
+     * @property  int  $plan_id  计划ID
+     * @property  string  $table_name  表名
+     * @property  int  $cleanup_type  清理类型:1清空表,2删除所有,3按时间删除,4按用户删除,5按条件删除
+     * @property  array  $conditions  清理条件JSON配置
+     * @property  int  $priority  清理优先级
+     * @property  int  $batch_size  批处理大小
+     * @property  bool  $is_enabled  是否启用
+     * @property  bool  $backup_enabled  是否启用备份
+     * @property  string  $notes  备注说明
+     * @property  \Carbon\Carbon  $created_at  创建时间
+     * @property  \Carbon\Carbon  $updated_at  更新时间
+     */
+    // field end
 
     /**
      * 字段类型转换

+ 25 - 23
app/Module/Cleanup/Models/CleanupTask.php

@@ -19,29 +19,31 @@ class CleanupTask extends ModelCore
      */
     protected $table = 'cleanup_tasks';
 
-    // field start 
- * @property  int  $id  主键ID
- * @property  string  $task_name  任务名称
- * @property  int  $plan_id  关联的清理计划ID
- * @property  int  $backup_id  关联的备份ID
- * @property  int  $status  任务状态:1待执行,2备份中,3执行中,4已完成,5已失败,6已取消,7已暂停
- * @property  float  $progress  执行进度百分比
- * @property  string  $current_step  当前执行步骤
- * @property  int  $total_tables  总表数
- * @property  int  $processed_tables  已处理表数
- * @property  int  $total_records  总记录数
- * @property  int  $deleted_records  已删除记录数
- * @property  int  $backup_size  备份文件大小(字节)
- * @property  float  $execution_time  执行时间(秒)
- * @property  float  $backup_time  备份时间(秒)
- * @property  \Carbon\Carbon  $started_at  开始时间
- * @property  \Carbon\Carbon  $backup_completed_at  备份完成时间
- * @property  \Carbon\Carbon  $completed_at  完成时间
- * @property  string  $error_message  错误信息
- * @property  int  $created_by  创建者用户ID
- * @property  \Carbon\Carbon  $created_at  创建时间
- * @property  \Carbon\Carbon  $updated_at  更新时间
- * field end
+    // field start
+    /**
+     * @property  int  $id  主键ID
+     * @property  string  $task_name  任务名称
+     * @property  int  $plan_id  关联的清理计划ID
+     * @property  int  $backup_id  关联的备份ID
+     * @property  int  $status  任务状态:1待执行,2备份中,3执行中,4已完成,5已失败,6已取消,7已暂停
+     * @property  float  $progress  执行进度百分比
+     * @property  string  $current_step  当前执行步骤
+     * @property  int  $total_tables  总表数
+     * @property  int  $processed_tables  已处理表数
+     * @property  int  $total_records  总记录数
+     * @property  int  $deleted_records  已删除记录数
+     * @property  int  $backup_size  备份文件大小(字节)
+     * @property  float  $execution_time  执行时间(秒)
+     * @property  float  $backup_time  备份时间(秒)
+     * @property  \Carbon\Carbon  $started_at  开始时间
+     * @property  \Carbon\Carbon  $backup_completed_at  备份完成时间
+     * @property  \Carbon\Carbon  $completed_at  完成时间
+     * @property  string  $error_message  错误信息
+     * @property  int  $created_by  创建者用户ID
+     * @property  \Carbon\Carbon  $created_at  创建时间
+     * @property  \Carbon\Carbon  $updated_at  更新时间
+     */
+    // field end
 
     /**
      * 字段类型转换

+ 39 - 0
fix_actions.sh

@@ -0,0 +1,39 @@
+#!/bin/bash
+
+# 批量修复 Cleanup 模块 Action 文件中的 render 方法问题
+
+files=(
+    "app/Module/Cleanup/AdminControllers/Actions/ViewBackupFilesAction.php"
+    "app/Module/Cleanup/AdminControllers/Actions/DeleteBackupAction.php"
+    "app/Module/Cleanup/AdminControllers/Actions/CleanOldLogsAction.php"
+    "app/Module/Cleanup/AdminControllers/Actions/CreateTaskAction.php"
+    "app/Module/Cleanup/AdminControllers/Actions/StartTaskAction.php"
+    "app/Module/Cleanup/AdminControllers/Actions/ViewTaskLogsAction.php"
+    "app/Module/Cleanup/AdminControllers/Actions/CleanExpiredBackupsAction.php"
+    "app/Module/Cleanup/AdminControllers/Actions/CancelTaskAction.php"
+    "app/Module/Cleanup/AdminControllers/Actions/PauseTaskAction.php"
+    "app/Module/Cleanup/AdminControllers/Actions/RestoreBackupAction.php"
+    "app/Module/Cleanup/AdminControllers/Actions/ResumeTaskAction.php"
+    "app/Module/Cleanup/AdminControllers/Actions/ViewBackupAction.php"
+    "app/Module/Cleanup/AdminControllers/Actions/ExportLogsAction.php"
+    "app/Module/Cleanup/AdminControllers/Actions/DownloadBackupAction.php"
+)
+
+for file in "${files[@]}"; do
+    if [ -f "$file" ]; then
+        echo "Processing $file..."
+        
+        # 使用 sed 删除 render 方法
+        sed -i '/\/\*\*/,/\*\// {
+            /渲染按钮/,/\*\// d
+        }' "$file"
+        
+        sed -i '/public function render()/,/^    }$/ d' "$file"
+        
+        echo "Fixed $file"
+    else
+        echo "File not found: $file"
+    fi
+done
+
+echo "All files processed!"