* [bug#55858,done,2.5h] fix order error.

This commit is contained in:
tianshujie
2025-01-06 15:30:48 +08:00
committed by 刘梦艺
parent b9b367e375
commit 097e46e889
2 changed files with 3 additions and 2 deletions
-1
View File
@@ -1938,7 +1938,6 @@ class story extends control
$this->config->story->dtable->fieldList['plan']['dataSource'] = array('module' => 'productplan', 'method' => 'getPairs', 'params' => array($productIdList));
}
$this->post->set('rows', $this->story->getExportStories($orderBy, $storyType, $postData));
$this->fetch('transfer', 'export', "model=$storyType");
}
+3 -1
View File
@@ -647,6 +647,7 @@ class transferModel extends model
$checkedItem = $this->post->checkedItem ? $this->post->checkedItem : $this->cookie->checkedItem;
$onlyCondition = $this->session->{$module . 'OnlyCondition'};
$queryCondition = $this->session->{$module . 'QueryCondition'};
$orderBy = $this->session->{$module . 'OrderBy'};
/* 插入用例场景数据。*/
/* Fetch the scene's cases. */
@@ -673,6 +674,7 @@ class transferModel extends model
}
$moduleDatas = $sql->where($queryCondition)
->beginIF($this->post->exportType == 'selected')->andWhere('t1.id')->in($checkedItem)->fi()
->beginIF($orderBy)->orderBy($orderBy)->fi()
->fetchAll('id', false);
}
elseif($queryCondition)
@@ -685,7 +687,7 @@ class transferModel extends model
preg_match_all('/[`"]' . $this->config->db->prefix . $module .'[`"] AS ([\w]+) /', $queryCondition, $matches);
if(isset($matches[1][0])) $selectKey = "{$matches[1][0]}.id";
$stmt = $this->dbh->query($queryCondition . ($this->post->exportType == 'selected' ? " AND $selectKey IN(" . ($checkedItem ? $checkedItem : '0') . ")" : ''));
$stmt = $this->dbh->query($queryCondition . ($this->post->exportType == 'selected' ? " AND $selectKey IN(" . ($checkedItem ? $checkedItem : '0') . ")" : '') . ($orderBy ? " ORDER BY $orderBy" : ''));
while($row = $stmt->fetch())
{
if($selectKey !== 't1.id' and isset($row->$module) and isset($row->id)) $row->id = $row->$module;