From fdc44afd2f850f9466d6c2a1d1fde9babe53da78 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Thu, 16 Jul 2020 13:05:53 +0800 Subject: [PATCH 1/2] * Finish task #7471. --- module/release/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/release/model.php b/module/release/model.php index 4c456018b8..db98fadded 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -111,13 +111,13 @@ class releaseModel extends model { $productID = (int)$productID; $branch = (int)$branch; - $buildID = 0; + $buildID = strpos($this->config->release->create->requiredFields, 'build') === false ? 0 : ''; /* Check date must be not more than today. */ if($this->post->date > date('Y-m-d')) return dao::$errors[] = $this->lang->release->errorDate; /* Auto create build when release is not link build. */ - if($this->post->build == false && $this->post->name) + if($this->post->build == false and $this->post->name and strpos($this->config->release->create->requiredFields, 'build') === false) { $build = $this->dao->select('*')->from(TABLE_BUILD) ->where('deleted')->eq('0') @@ -161,7 +161,7 @@ class releaseModel extends model ->stripTags($this->config->release->editor->create['id'], $this->config->allowedTags) ->remove('allchecker,files,labels,uid') ->get(); - + $release = $this->loadModel('file')->processImgURL($release, $this->config->release->editor->create['id'], $this->post->uid); $this->dao->insert(TABLE_RELEASE)->data($release) ->autoCheck() From d0a458160ff04d688039c55227f7d24de0a4e56d Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Thu, 16 Jul 2020 13:07:23 +0800 Subject: [PATCH 2/2] * Finish #7471. --- module/task/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/task/model.php b/module/task/model.php index 3c678ff1ff..eff18c2973 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -2491,6 +2491,7 @@ class taskModel extends model { $tasks = $this->dao->select('id,deadline')->from(TABLE_TASK)->alias('t1') ->where($this->reportCondition()) + ->orderBy('deadline asc') ->fetchAll('id'); if(!$tasks) return array(); @@ -2662,7 +2663,7 @@ class taskModel extends model if(!isset($fields[$task->$field])) $fields[$task->$field] = 0; $fields[$task->$field] ++; } - asort($fields); + if($field != 'date' and $field != 'deadline') asort($fields); foreach($fields as $field => $count) { $data = new stdclass();