From 5688747029409fc449dfadc5638d34c2b4ec13c9 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 12 Dec 2019 08:58:32 +0800 Subject: [PATCH] * fix page count. --- module/repo/model.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/repo/model.php b/module/repo/model.php index 966c37e773..2daf855e04 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -229,8 +229,12 @@ class repoModel extends model { $historyIdList = $this->dao->select('DISTINCT t2.id')->from(TABLE_REPOFILES)->alias('t1') ->leftJoin(TABLE_REPOHISTORY)->alias('t2')->on('t1.revision=t2.id') + ->leftJoin(TABLE_REPOBRANCH)->alias('t3')->on('t2.id=t3.revision') ->where('1=1') ->andWhere('t1.repo')->eq($repo->id) + ->andWhere('t2.`time`')->le($revisionTime) + ->andWhere('left(t2.comment, 12)')->ne('Merge branch') + ->beginIF($this->cookie->repoBranch)->andWhere('t3.branch')->eq($this->cookie->repoBranch)->fi() ->beginIF($type == 'dir') ->andWhere('t1.parent', true)->like(rtrim($entry, '/') . "/%") ->orWhere('t1.parent')->eq(rtrim($entry, '/')) @@ -238,7 +242,7 @@ class repoModel extends model ->fi() ->beginIF($type == 'file')->andWhere('t1.path')->eq("$entry")->fi() ->orderBy('t2.`time` desc') - ->page($pager) + ->page($pager, 't2.id') ->fetchPairs('id', 'id'); }