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
+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)