From 821d93a2cd5304f64a05a48da7f270e8f235380a Mon Sep 17 00:00:00 2001 From: wangjianhua Date: Sun, 9 Oct 2022 15:03:41 +0800 Subject: [PATCH] * Improve codes to query product. --- module/repo/control.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/repo/control.php b/module/repo/control.php index d22d7aa78e..14afe0b7df 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -213,7 +213,11 @@ class repo extends control $shadowProduct = null; $productIDList = explode(',', $repo->product); /* Code repository linked only one project without product. */ - if(count($productIDList) == 1) $shadowProduct = $this->dao->select('*')->from(TABLE_PRODUCT)->where('shadow')->eq(1)->andWhere('id')->eq($productIDList[0])->fetch(); + if(count($productIDList) == 1) + { + $shadowProduct = $this->loadModel('product')->getByID($productIDList[0]); + $shadowProduct = $shadowProduct && $shadowProduct->shadow ? $shadowProduct : null; + } $this->view->title = $this->lang->repo->common . $this->lang->colon . $this->lang->repo->edit; $this->view->repo = $repo;