perf: 导出报表调整

This commit is contained in:
韦荣超
2022-03-02 15:19:48 +08:00
parent 54d215b8d1
commit 827bc97e8e
5 changed files with 130 additions and 1 deletions

View File

@@ -376,6 +376,7 @@ class Project extends AbstractModel
$idc = [];
$hasStart = false;
$hasEnd = false;
$testNum = 0;
$upTaskList = [];
foreach ($flows as $item) {
$id = intval($item['id']);
@@ -416,6 +417,9 @@ class Project extends AbstractModel
if ($flow->status == 'end') {
$hasEnd = true;
}
if ($flow->status == 'test') {
$testNum++;
}
if (!$isInsert) {
$upTaskList[$flow->id] = $flow->status . "|" . $flow->name;
}
@@ -424,6 +428,9 @@ class Project extends AbstractModel
if (!$hasStart) {
throw new ApiException('至少需要1个开始状态');
}
if($testNum > 1){
throw new ApiException('验收/测试状态只能有1个');
}
if (!$hasEnd) {
throw new ApiException('至少需要1个结束状态');
}