数据分析平台

This commit is contained in:
jh_peng 2024-12-20 14:44:02 +08:00
parent 24f258aa3c
commit 22371c5ea6

View File

@ -313,9 +313,6 @@ func PassProbabilityByFactory(r *request.PassProbabilityByFactory) ([]*model.Lin
}
month := carbon.Now().SubYear().StartOfMonth().Format("Y-m")
for {
if month == carbon.Now().EndOfMonth().Format("Y-m") {
break
}
x = append(x, month)
if _, ok := factoryMap[month]; !ok {
lineY = append(lineY, "")
@ -340,6 +337,9 @@ func PassProbabilityByFactory(r *request.PassProbabilityByFactory) ([]*model.Lin
histogramY = append(histogramY, factoryMap[month][0])
}
if month == carbon.Now().EndOfMonth().Format("Y-m") {
break
}
month = carbon.Parse(month).AddMonth().Format("Y-m")
}
lines = append(lines, &model.Line{
@ -429,9 +429,6 @@ func FTPassProbabilityByProduct(r *request.PassProbabilityByProduct) (*model.Lin
month := carbon.Now().SubYear().AddMonth().Format("Y-m")
var testStr, passStr string
for {
if month == carbon.Now().AddMonth().Format("Y-m") {
break
}
x = append(x, month)
if _, ok := productMap[month]; !ok {
lineY = append(lineY, "")
@ -455,6 +452,9 @@ func FTPassProbabilityByProduct(r *request.PassProbabilityByProduct) (*model.Lin
lineY = append(lineY, passProbability.String())
histogramY = append(histogramY, productMap[month][0])
}
if month == carbon.Now().AddMonth().Format("Y-m") {
break
}
month = carbon.Parse(month).AddMonth().Format("Y-m")
}