caipin 4 лет назад
Родитель
Сommit
95bb185516
1 измененных файлов с 10 добавлено и 0 удалено
  1. 10 0
      services/contract_service.go

+ 10 - 0
services/contract_service.go

@@ -265,6 +265,16 @@ func (s *contractService) Get(treeId int, bidsectionId int, projectId int) *view
 	section := s.treeContractDao.Get(treeId, bidsectionId, projectId)
 	// 2.构造数据
 	sectionVM := s.makeSectionView(section)
+	// 3.更新 上移和下一的限制
+	youngerBrotherList := s.treeContractDao.GetYoungerBrother(section.Serial, section.Depth, section.ParentId, bidsectionId, projectId)
+	if len(youngerBrotherList) == 0 {
+		sectionVM.IsEnd = true
+	}
+	sectionVM.ElderBrother = true
+	elderBrotherList := s.treeContractDao.GetElderBrother(section.Serial, section.Depth, section.ParentId, bidsectionId, projectId)
+	if len(elderBrotherList) == 0 {
+		sectionVM.ElderBrother = false
+	}
 	return sectionVM
 }