* [bug#58493] adjust release linked system data.

This commit is contained in:
caoyanyi
2024-12-23 15:20:36 +08:00
committed by 李阳
parent 7c52bf22b7
commit 7bd53254d4
4 changed files with 8 additions and 7 deletions
+3 -2
View File
@@ -652,16 +652,17 @@ class release extends control
*
* @param int $systemID
* @param string $linkedRelease
* @param int $releaseID
* @access public
* @return void
*/
public function ajaxLoadSystemBlock(int $systemID, string $linkedRelease = '')
public function ajaxLoadSystemBlock(int $systemID, string $linkedRelease = '', int $releaseID = 0)
{
$system = $this->loadModel('system')->fetchByID($systemID);
$children = explode(',', $system->children);
$appList = $this->system->getByIdList($children);
$releases = $this->release->getListBySystem($children);
$releases = $this->release->getListBySystem($children, $releaseID);
$this->view->appList = $appList;
$this->view->releases = $releases;
+1 -1
View File
@@ -9,7 +9,7 @@ window.loadSystemBlock = function()
if(typeof linkedRelease == 'undefined') linkedRelease = '';
$('#systemBlock').removeClass('hidden');
loadTarget($.createLink('release', 'ajaxLoadSystemBlock', `systemID=${systemID}&release=${linkedRelease}`), 'systemItems');
loadTarget($.createLink('release', 'ajaxLoadSystemBlock', `systemID=${systemID}&release=${linkedRelease}&releaseID=${releaseID}`), 'systemItems');
}
else
{
+3 -1
View File
@@ -220,14 +220,16 @@ class releaseModel extends model
* Get releases by system.
*
* @param array $systemList
* @param int $filterRelease
* @access public
* @return array
*/
public function getListBySystem(array $systemList): array
public function getListBySystem(array $systemList, int $filterRelease = 0): array
{
return $this->dao->select('*')->from(TABLE_RELEASE)
->where('deleted')->eq(0)
->andWhere('system')->in($systemList)
->beginIF($filterRelease)->andWhere('id')->ne($filterRelease)->fi()
->orderBy('id DESC')
->fetchAll('id');
}
+1 -3
View File
@@ -15,6 +15,7 @@ jsVar('oldStatus', $release->status);
jsVar('linkedRelease', $release->releases);
jsVar('productID', zget($product, 'id', 0));
jsVar('releaseBuilds', $release->build);
jsVar('releaseID', $release->id);
formPanel
(
@@ -138,6 +139,3 @@ formPanel
),
formHidden('product', $release->product)
);
/* ====== Render page ====== */
render();