From 7dfc3f64a2dc687fec2e77d3a619aec6f81d9bff Mon Sep 17 00:00:00 2001 From: sunjun Date: Thu, 16 Jun 2022 05:49:32 +0000 Subject: [PATCH] fixbug_sunjun_23810 --- module/product/model.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/module/product/model.php b/module/product/model.php index 89742f3dd8..11c790166b 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -917,13 +917,16 @@ class productModel extends model $data = fixer::input('post')->get(); /* When there are products under the line, the program cannot be modified */ - foreach($oldLines as $oldLine) + if($this->config->systemMode == 'new') { - $oldLineID = 'id' . $oldLine->id; - if($data->programs[$oldLineID] != $oldLine->root) + foreach($oldLines as $oldLine) { - $product = $this->dao->select('*')->from(TABLE_PRODUCT)->where('line')->eq($oldLine->id)->fetch(); - if(!empty($product)) return print(js::error($this->lang->product->changeLineError)); + $oldLineID = 'id' . $oldLine->id; + if($data->programs[$oldLineID] != $oldLine->root) + { + $product = $this->dao->select('*')->from(TABLE_PRODUCT)->where('line')->eq($oldLine->id)->fetch(); + if(!empty($product)) return print(js::error($this->lang->product->changeLineError)); + } } }