* Get distinct records, fix bug #1453.

This commit is contained in:
daitingting
2018-03-14 17:36:22 +08:00
parent d1d033ddd9
commit 287d317359
+2 -2
View File
@@ -1600,12 +1600,12 @@ class storyModel extends model
->fetchPairs();
$sql = str_replace(array('`product`', '`version`'), array('t1.`product`', 't1.`version`'), $sql);
$tmpStories = $this->dao->select('t1.*')->from(TABLE_STORY)->alias('t1')
$tmpStories = $this->dao->select('DISTINCT t1.*')->from(TABLE_STORY)->alias('t1')
->leftJoin(TABLE_PROJECTSTORY)->alias('t2')->on('t1.id=t2.story')
->where($sql)
->beginIF($productID != 'all' and $productID != '')->andWhere('t1.`product`')->eq((int)$productID)->fi()
->andWhere('deleted')->eq(0)
->orderBy($orderBy)
->orderBy($orderBy, 't1.id')
->page($pager)
->fetchAll('id');