From 361da737a9ace0b4dcb40e41f866ffbd1c81cebf Mon Sep 17 00:00:00 2001 From: dingguodong Date: Fri, 7 Jun 2024 16:44:38 +0800 Subject: [PATCH] * [task#116512] Optimize the backup method. --- module/system/model.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/system/model.php b/module/system/model.php index bd73947be8..0a0aa52c37 100644 --- a/module/system/model.php +++ b/module/system/model.php @@ -24,6 +24,7 @@ class systemModel extends model parent::__construct(); $this->loadModel('setting'); $this->loadModel('cne'); + $this->loadModel('instance'); } /** @@ -134,8 +135,10 @@ class systemModel extends model * @param string $mode |manual|system|upgrade|downgrade * @return array */ - public function backup(object $instance, string $mode = ''): array + public function backup(?object $instance, string $mode = ''): array { + if(empty($instance)) $instance = $this->config->instance->zentaopaas; + $rawResult = $this->cne->backup($instance, $this->app->user->account, $mode); if(!empty($rawResult->code) && $rawResult->code == 200)