diff --git a/module/action/model.php b/module/action/model.php index 5d5d0dbd9c..a9315f2b00 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1716,6 +1716,30 @@ class actionModel extends model $dateGroup[$date][] = $action; } + /* 查询数据并且写入日期分组中。 */ + /* Query data and write into data packets. */ + if($dateGroup) + { + $lastDateActions = $this->dao->select('action.*')->from(TABLE_ACTION)->alias('action') + ->leftJoin(TABLE_ACTIONPRODUCT)->alias('t2')->on('action.id=t2.action') + ->where($this->session->actionQueryCondition) + ->andWhere("(LEFT(`date`, 10) = '" . substr($action->originalDate, 0, 10) . "')") + ->orderBy($this->session->actionOrderBy) + ->fetchAll('id', false); + if(count($dateGroup[$date]) < count($lastDateActions)) + { + unset($dateGroup[$date]); + $lastDateActions = $this->transformActions($lastDateActions); + foreach($lastDateActions as $action) + { + $timeStamp = strtotime(isset($action->originalDate) ? $action->originalDate : $action->date); + $date = date(DT_DATE3, $timeStamp); + $action->time = date(DT_TIME2, $timeStamp); + $dateGroup[$date][] = $action; + } + } + } + /* 将日期的顺序修改正确。 */ /* Modify date to the corrret order. */ if($this->app->rawModule != 'company' && $direction != 'next') diff --git a/module/company/control.php b/module/company/control.php index e5bf486196..773c34faf1 100755 --- a/module/company/control.php +++ b/module/company/control.php @@ -176,7 +176,7 @@ class company extends control /* 根据日期补充动态数据。*/ /* Supplement action by date.*/ $dateGroups = $this->action->buildDateGroup($actions, $direction, $orderBy); - $recTotal = $this->action->getDynamicCount(); + if(empty($recTotal)) $recTotal = !(empty($date) && $browseType == 'all') ? array_sum(array_map('count', $dateGroups)) : $this->action->getDynamicCount(); /* Assign.*/ $this->view->title = $this->lang->company->common . $this->lang->hyphen . $this->lang->company->dynamic; diff --git a/module/company/ui/dynamic.html.php b/module/company/ui/dynamic.html.php index 0a86333182..e2640c38c8 100644 --- a/module/company/ui/dynamic.html.php +++ b/module/company/ui/dynamic.html.php @@ -89,7 +89,6 @@ featureBar li(searchToggle(set::module('action'), set::open($browseType == 'bysearch'))) ); -global $app; $content = null; if(empty($dateGroups)) { @@ -146,22 +145,6 @@ else ); } - $hasMore = $app->control->loadModel('action')->hasMoreAction($lastAction); - if($hasMore) - { - $content[] = li - ( - a - ( - setID('showMoreDynamic'), - setClass('block text-center'), - setData(array('lastid' => $lastAction->id)), - set::href('###'), - on::click('showMore'), - icon('chevron-double-down') - ) - ); - } $content = ul ( setClass('timeline list-none p-0'),