From 035bf84dc510e9d4c139ddcac643236ccffd21e6 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 2 Nov 2023 11:02:35 +0800 Subject: [PATCH] * Fix bug of dynamic count. --- module/company/control.php | 2 +- module/execution/control.php | 2 +- module/my/control.php | 2 +- module/product/control.php | 2 +- module/project/control.php | 2 +- module/user/control.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/company/control.php b/module/company/control.php index 55b236648d..93b461205f 100755 --- a/module/company/control.php +++ b/module/company/control.php @@ -287,7 +287,7 @@ class company extends control $this->loadModel('search')->setSearchParams($this->config->company->dynamic->search); $dateGroups = $this->action->buildDateGroup($actions, $direction, $orderBy); - if(empty($recTotal)) $recTotal = count($dateGroups) < 2 ? count(reset($dateGroups)) : $this->action->getDynamicCount(); + if(empty($recTotal)) $recTotal = count($dateGroups) < 2 ? count($dateGroups, true) - count($dateGroups) : $this->action->getDynamicCount(); /* Assign. */ $this->view->recTotal = $recTotal; diff --git a/module/execution/control.php b/module/execution/control.php index 32e613ea93..441f625f61 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2362,7 +2362,7 @@ class execution extends control $date = empty($date) ? '' : date('Y-m-d', $date); $actions = $this->loadModel('action')->getDynamic($account, $period, $orderBy, 50, 'all', 'all', $executionID, $date, $direction); $dateGroups = $this->action->buildDateGroup($actions, $direction); - if(empty($recTotal)) $recTotal = count($dateGroups) < 2 ? count(reset($dateGroups)) : $this->action->getDynamicCount(); + if(empty($recTotal)) $recTotal = count($dateGroups) < 2 ? count($dateGroups, true) - count($dateGroups) : $this->action->getDynamicCount(); $this->view->title = $execution->name . $this->lang->colon . $this->lang->execution->dynamic; $this->view->userIdPairs = $this->loadModel('user')->getTeamMemberPairs($executionID, 'execution', 'nodeleted|useid'); diff --git a/module/my/control.php b/module/my/control.php index 61375ce5c9..490b9d06a1 100755 --- a/module/my/control.php +++ b/module/my/control.php @@ -1564,7 +1564,7 @@ EOF; $actions = $this->loadModel('action')->getDynamic($this->app->user->account, $type, $orderBy, 50, 'all', 'all', 'all', $date, $direction); $dateGroups = $this->action->buildDateGroup($actions, $direction); - if(empty($recTotal)) $recTotal = count($dateGroups) < 2 ? count(reset($dateGroups)) : $this->action->getDynamicCount(); + if(empty($recTotal)) $recTotal = count($dateGroups) < 2 ? count($dateGroups, true) - count($dateGroups) : $this->action->getDynamicCount(); /* Assign. */ $this->view->type = $type; diff --git a/module/product/control.php b/module/product/control.php index 85c65eb1e8..c68c1c85c3 100755 --- a/module/product/control.php +++ b/module/product/control.php @@ -465,7 +465,7 @@ class product extends control /* Get actions. */ list($actions, $dateGroups) = $this->productZen->getActionsForDynamic($account, $orderBy, $productID, $type, $recTotal, $date, $direction); - if(empty($recTotal)) $recTotal = count($dateGroups) < 2 ? count(reset($dateGroups)) : $this->action->getDynamicCount(); + if(empty($recTotal)) $recTotal = count($dateGroups) < 2 ? count($dateGroups, true) - count($dateGroups) : $this->action->getDynamicCount(); /* Assign. */ $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->product->dynamic; diff --git a/module/project/control.php b/module/project/control.php index 70feb42a76..87e675038d 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -695,7 +695,7 @@ class project extends control $date = empty($date) ? '' : date('Y-m-d', $date); $actions = $this->loadModel('action')->getDynamic($account, $period, $orderBy, 50, 'all', $projectID, 'all', $date, $direction); $dateGroups = $this->action->buildDateGroup($actions, $direction); - if(empty($recTotal)) $recTotal = count($dateGroups) < 2 ? count(reset($dateGroups)) : $this->action->getDynamicCount(); + if(empty($recTotal)) $recTotal = count($dateGroups) < 2 ? count($dateGroups, true) - count($dateGroups) : $this->action->getDynamicCount(); /* The header and position. */ $project = $this->project->getByID($projectID); diff --git a/module/user/control.php b/module/user/control.php index d40b9dc6bb..013ad5b113 100755 --- a/module/user/control.php +++ b/module/user/control.php @@ -1216,7 +1216,7 @@ class user extends control $date = empty($date) ? '' : date('Y-m-d', $date); $actions = $this->loadModel('action')->getDynamic($account, $period, $orderBy, 50, 'all', 'all', 'all', $date, $direction); $dateGroups = $this->action->buildDateGroup($actions, $direction); - if(empty($recTotal)) $recTotal = count($dateGroups) < 2 ? count(reset($dateGroups)) : $this->action->getDynamicCount(); + if(empty($recTotal)) $recTotal = count($dateGroups) < 2 ? count($dateGroups, true) - count($dateGroups) : $this->action->getDynamicCount(); /* Assign. */ $this->view->title = $this->lang->user->common . $this->lang->colon . $this->lang->user->dynamic;