Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -373,12 +373,20 @@ LIMIT 1
|
||||
row.MappingWarning = "PG urun veya varyant token eslesmesi bulunamadi"
|
||||
}
|
||||
assignKey := assignmentKey(row.ProductCode, row.Dim1ID, row.Dim3ID)
|
||||
for _, id := range existing[assignKey] {
|
||||
if d, ok := defByID[id]; ok {
|
||||
row.SeriesIDs = append(row.SeriesIDs, id)
|
||||
row.Series = append(row.Series, d)
|
||||
appendSeries := func(key string) {
|
||||
for _, id := range existing[key] {
|
||||
if d, ok := defByID[id]; ok {
|
||||
row.SeriesIDs = append(row.SeriesIDs, id)
|
||||
row.Series = append(row.Series, d)
|
||||
}
|
||||
}
|
||||
}
|
||||
appendSeries(assignKey)
|
||||
// Fallback: if we couldn't match dim3-specific assignments (dim3 token ambiguity / missing),
|
||||
// show the default (dim3 NULL) assignments for the same product+color.
|
||||
if len(row.SeriesIDs) == 0 && row.Dim3Code != "" && row.Dim1ID > 0 {
|
||||
appendSeries(assignmentKey(row.ProductCode, row.Dim1ID, 0))
|
||||
}
|
||||
sort.Slice(row.Series, func(i, j int) bool { return row.Series[i].Code < row.Series[j].Code })
|
||||
sort.Slice(row.SeriesIDs, func(i, j int) bool { return row.SeriesIDs[i] < row.SeriesIDs[j] })
|
||||
out = append(out, *row)
|
||||
|
||||
Reference in New Issue
Block a user