From 6a32463f7f50ecc4e53cc0d70707efecf574abd6 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Sat, 10 Jun 2023 15:24:44 +0800 Subject: [PATCH] * Fix syntax error. --- module/product/tao.php | 17 ++++++++--------- module/project/control.php | 2 +- module/project/zen.php | 10 +++++----- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/module/product/tao.php b/module/product/tao.php index 080affa8c0..5ad01987b3 100644 --- a/module/product/tao.php +++ b/module/product/tao.php @@ -682,22 +682,21 @@ class productTao extends productModel * 获取项目关联的产品。 * Get products by project ID. * - * @param int $projectID - * @param string $append '1,2,3' - * @param string $status - * @param string $orderBy - * @param bool $noDeleted + * @param int $projectID + * @param string|array $append '1,2,3' + * @param string $status + * @param string $orderBy + * @param bool $noDeleted * @access protected * @return int[] */ - protected function getProductsByProjectID(int $projectID, string $append, string $status, string $orderBy, bool $noDeleted = true): array + protected function getProductsByProjectID(int $projectID, string|array $append, string $status, string $orderBy, bool $noDeleted = true): array { /* 处理要用的到变量信息。 */ $append = $this->formatAppendParam($append); $orderBy = ($orderBy ? "{$orderBy}," : '') . 't2.order asc'; - return $this->dao->select("t1.branch, t1.plan, t2.*") - ->from(TABLE_PROJECTPRODUCT)->alias('t1') + return $this->dao->select("t1.branch, t1.plan, t2.*")->from(TABLE_PROJECTPRODUCT)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') ->where('(1=1') ->beginIF($noDeleted)->andWhere('t2.deleted')->eq(0)->fi() @@ -706,7 +705,7 @@ class productTao extends productModel ->andWhere('t2.vision')->eq($this->config->vision) ->beginIF(strpos($status, 'noclosed') !== false)->andWhere('t2.status')->ne('closed')->fi() ->markRight(1) - ->beginIF($append)->orWhere('t1.id')->in($append)->fi() + ->beginIF($append)->orWhere('t2.id')->in($append)->fi() ->orderBy($orderBy) ->fetchAll(); } diff --git a/module/project/control.php b/module/project/control.php index cf4f4f2669..82dfd5453a 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -193,7 +193,7 @@ class project extends control * @access public * @return string */ - public function ajaxGetLinkedProducts(string $projectID): string + public function ajaxGetLinkedProducts(string $projectID) { $productsWithBranch = array(); $linkedProducts = $this->project->getBranchesByProject((int)$projectID); diff --git a/module/project/zen.php b/module/project/zen.php index f77305a389..b3c03fd78b 100644 --- a/module/project/zen.php +++ b/module/project/zen.php @@ -900,15 +900,15 @@ class projectZen extends project * 获取其他的关联产品 * Get other products under the projectprogram. * - * @param object $programProducts - * @param array $branchGroups - * @param array $linkedBranches - * @param array $linkedProducts + * @param array $programProducts + * @param array $branchGroups + * @param array $linkedBranches + * @param array $linkedProducts * * @access protected * @return array */ - protected function getOtherProducts(object $programProducts, array $branchGroups, array $linkedBranches, array $linkedProducts): array + protected function getOtherProducts(array $programProducts, array $branchGroups, array $linkedBranches, array $linkedProducts): array { foreach($programProducts as $productID => $productName) {