From a6e0fce73ebd65d8c70ef795e285203306d0d107 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 4 Jul 2018 10:38:12 +0800 Subject: [PATCH] * finish task #4523. --- module/product/control.php | 1 + module/product/model.php | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index 0536959547..0df8c1a293 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -214,6 +214,7 @@ class product extends control } $rootID = key($this->products); + if($this->session->product) $rootID = $this->session->product; $this->product->setMenu($this->products, $rootID); $this->view->title = $this->lang->product->create; diff --git a/module/product/model.php b/module/product/model.php index 8a88879390..971ff72fc7 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -352,11 +352,11 @@ class productModel extends model public function create() { $product = fixer::input('post') - ->setIF($this->post->acl != 'custom', 'whitelist', '') - ->setDefault('status', 'normal') - ->setDefault('createdBy', $this->app->user->account) - ->setDefault('createdDate', helper::now()) - ->setDefault('createdVersion', $this->config->version) + ->setIF($this->post->acl != 'custom', 'whitelist', '') + ->setDefault('status', 'normal') + ->setDefault('createdBy', $this->app->user->account) + ->setDefault('createdDate', helper::now()) + ->setDefault('createdVersion', $this->config->version) ->join('whitelist', ',') ->stripTags($this->config->product->editor->create['id'], $this->config->allowedTags) ->remove('uid')