From 03d889254958cecd0604d4535de2f4695b5ae327 Mon Sep 17 00:00:00 2001 From: wangxuepeng Date: Mon, 9 Oct 2023 08:00:29 +0000 Subject: [PATCH] * Refactor actionModel::buildDateGroup. --- module/action/model.php | 5 ++--- 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 +- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/module/action/model.php b/module/action/model.php index 7b7f60c457..2327b6719b 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1378,12 +1378,11 @@ class actionModel extends model * * @param array $actions * @param string $direction - * @param string $type all|today|yesterday|thisweek|lastweek|thismonth|lastmonth - * @param string $orderBy date_desc|date_asc + * @param string $orderBy date_desc|date_asc * @access public * @return array */ - public function buildDateGroup(array $actions, string $direction = 'next', string $type = 'today', string $orderBy = 'date_desc'): array + public function buildDateGroup(array $actions, string $direction = 'next', string $orderBy = 'date_desc'): array { $dateGroup = array(); foreach($actions as $action) diff --git a/module/company/control.php b/module/company/control.php index 40b33e2b7a..3a8e0715c1 100755 --- a/module/company/control.php +++ b/module/company/control.php @@ -303,7 +303,7 @@ class company extends control $this->view->pager = $pager; $this->view->userID = $userID; $this->view->param = $param; - $this->view->dateGroups = $this->action->buildDateGroup($actions, $direction, $browseType, $orderBy); + $this->view->dateGroups = $this->action->buildDateGroup($actions, $direction, $orderBy); $this->view->direction = $direction; $this->display(); } diff --git a/module/execution/control.php b/module/execution/control.php index 81d21ea82b..646219da71 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2361,7 +2361,7 @@ class execution extends control $this->view->pager = $pager; $this->view->account = $account; $this->view->param = $param; - $this->view->dateGroups = $this->action->buildDateGroup($actions, $direction, $type); /* 将日志按照日期分组,以日期为索引,将日志列表作为值。*/ + $this->view->dateGroups = $this->action->buildDateGroup($actions, $direction); /* 将日志按照日期分组,以日期为索引,将日志列表作为值。*/ $this->view->direction = $direction; $this->view->recTotal = $recTotal; $this->display(); diff --git a/module/my/control.php b/module/my/control.php index cfcd31acf4..61d5cafa24 100755 --- a/module/my/control.php +++ b/module/my/control.php @@ -1564,7 +1564,7 @@ EOF; $this->view->type = $type; $this->view->orderBy = $orderBy; $this->view->pager = $pager; - $this->view->dateGroups = $this->action->buildDateGroup($actions, $direction, $type); + $this->view->dateGroups = $this->action->buildDateGroup($actions, $direction); $this->view->direction = $direction; $this->view->originTotal = $originTotal; $this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted'); diff --git a/module/product/control.php b/module/product/control.php index b7e7bdd08f..91811cc49c 100755 --- a/module/product/control.php +++ b/module/product/control.php @@ -449,7 +449,7 @@ class product extends control $this->view->user = isset($user) ? $user : ''; $this->view->param = $param; $this->view->pager = $pager; - $this->view->dateGroups = $this->action->buildDateGroup($actions, $direction, $type); + $this->view->dateGroups = $this->action->buildDateGroup($actions, $direction); $this->view->direction = $direction; $this->view->recTotal = $recTotal; diff --git a/module/project/control.php b/module/project/control.php index 0721a4ab4c..886571930e 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -715,7 +715,7 @@ class project extends control $this->view->pager = $pager; $this->view->account = $account; $this->view->param = $param; - $this->view->dateGroups = $this->action->buildDateGroup($actions, $direction, $type); + $this->view->dateGroups = $this->action->buildDateGroup($actions, $direction); $this->view->direction = $direction; $this->view->recTotal = $pager->recTotal; $this->display(); diff --git a/module/user/control.php b/module/user/control.php index f0c28df95d..46e086b136 100755 --- a/module/user/control.php +++ b/module/user/control.php @@ -1216,7 +1216,7 @@ class user extends control $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->pager = $pager; $this->view->user = $user; - $this->view->dateGroups = $this->action->buildDateGroup($actions, $direction, $period); + $this->view->dateGroups = $this->action->buildDateGroup($actions, $direction); $this->view->direction = $direction; $this->display(); }