This commit is contained in:
王怡栋
2022-11-22 15:34:40 +08:00
parent a1cded3942
commit 827f04e98a
5 changed files with 16 additions and 9 deletions
+6 -2
View File
@@ -3,24 +3,28 @@ $(function()
/* Update table summary text. */
var $rows = $('#releaseList').find('tbody>tr');
var total = 0;
var normal = 0;
var terminate = 0;
$rows.each(function()
{
var $row = $(this);
if($row.find('.c-id').length == 0) return;
var data = $row.data();
if(data.type === 'normal') normal++;
if(data.type === 'terminate') terminate++;
total++;
});
var summary = '';
if(type != 'all')
{
summary = pageSummary.replace('%s', $rows.length);
summary = pageSummary.replace('%s', total);
}
else
{
summary = pageAllSummary.replace('%total%', $rows.length).replace('%normal%', normal).replace('%terminate%', terminate);
summary = pageAllSummary.replace('%total%', total).replace('%normal%', normal).replace('%terminate%', terminate);
}
$('.table-statistic').html(summary);
});
+1 -1
View File
@@ -73,7 +73,7 @@
?>
<tr data-type='<?php echo $release->status;?>'>
<?php if($i == 0):?>
<td <?php echo $rowspan?>><?php echo html::a(inlink('view', "releaseID=$release->id"), sprintf('%03d', $release->id));?></td>
<td class='c-id' <?php echo $rowspan?>><?php echo html::a(inlink('view', "releaseID=$release->id"), sprintf('%03d', $release->id));?></td>
<td <?php echo $rowspan?>>
<?php
$flagIcon = $release->marker ? "<icon class='icon icon-flag red' title='{$lang->release->marker}'></icon> " : '';
+6 -2
View File
@@ -3,24 +3,28 @@ $(function()
/* Update table summary text. */
var $rows = $('#releaseList').find('tbody>tr');
var total = 0;
var normal = 0;
var terminate = 0;
$rows.each(function()
{
var $row = $(this);
if($row.find('td.c-id').length == 0) return;
var data = $row.data();
if(data.type === 'normal') normal++;
if(data.type === 'terminate') terminate++;
total++;
});
var summary = '';
if(type != 'all')
{
summary = pageSummary.replace('%s', $rows.length);
summary = pageSummary.replace('%s', total);
}
else
{
summary = pageAllSummary.replace('%total%', $rows.length).replace('%normal%', normal).replace('%terminate%', terminate);
summary = pageAllSummary.replace('%total%', total).replace('%normal%', normal).replace('%terminate%', terminate);
}
$('.table-statistic').html(summary);
});
+2 -3
View File
@@ -54,12 +54,11 @@ class releaseModel extends model
*/
public function getList($productID, $branch = 'all', $type = 'all', $orderBy = 't1.date_desc', $pager = null)
{
$releases = $this->dao->select('t1.*, t2.name as productName')
->from(TABLE_RELEASE)->alias('t1')
$releases = $this->dao->select('t1.*, t2.name as productName')->from(TABLE_RELEASE)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->where('t1.deleted')->eq(0)
->beginIF($productID)->andWhere('t1.product')->eq((int)$productID)->fi()
->beginIF($branch !== 'all')->andWhere('t1.branch')->like(",{$branch},")->fi()
->beginIF($branch !== 'all')->andWhere("FIND_IN_SET($branch, t1.branch)")->fi()
->beginIF($type != 'all' && $type != 'review')->andWhere('t1.status')->eq($type)->fi()
->beginIF($type == 'review')->andWhere("FIND_IN_SET('{$this->app->user->account}', t1.reviewers)")->fi()
->orderBy($orderBy)
+1 -1
View File
@@ -76,7 +76,7 @@
<?php foreach($release->builds as $build):?>
<tr data-type='<?php echo $release->status;?>'>
<?php if($i == 1):?>
<td <?php echo $rowspan?>><?php echo html::a(inlink('view', "releaseID=$release->id"), sprintf('%03d', $release->id));?></td>
<td class='c-id' <?php echo $rowspan?>><?php echo html::a(inlink('view', "releaseID=$release->id"), sprintf('%03d', $release->id));?></td>
<td <?php echo $rowspan?>>
<?php
$flagIcon = $release->marker ? "<icon class='icon icon-flag red' title='{$lang->release->marker}'></icon> " : '';