From b7ca55d9ca27d168cdc13b4c78cc9bd378445b4d Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Mon, 27 Dec 2021 11:36:46 +0800 Subject: [PATCH] * Adjust the params of createDemoData when manual import. --- module/api/control.php | 2 +- module/api/model.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/api/control.php b/module/api/control.php index 4a6906b2f0..915d37e223 100755 --- a/module/api/control.php +++ b/module/api/control.php @@ -321,7 +321,7 @@ class api extends control { if($type == 'demo') { - $libID = $this->api->createDemoData(); + $libID = $this->api->createDemoData($this->post->name, $this->post->baseUrl); return $this->sendSuccess(array('locate' => $this->createLink('api', 'index', "libID=$libID"))); } diff --git a/module/api/model.php b/module/api/model.php index 3ead15880a..6a4b4401fd 100644 --- a/module/api/model.php +++ b/module/api/model.php @@ -741,7 +741,7 @@ class apiModel extends model * @access public * @return int */ - public function createDemoData($name, $baseUrl, $version) + public function createDemoData($name, $baseUrl, $version = '16.0') { $firstAccount = $this->dao->select('account')->from(TABLE_USER)->orderBy('id_asc')->limit(1)->fetch('account'); $currentAccount = isset($this->app->user->account) ? $this->app->user->account : $firstAccount;