|
|
|
@@ -336,18 +336,20 @@ func updatePricing() { |
|
|
|
pricingMap = append(pricingMap, pricing) |
|
|
|
} |
|
|
|
|
|
|
|
// 按 sort_order 排序 pricingMap |
|
|
|
// 按 sort_order 排序 pricingMap,999999 视为未设置 |
|
|
|
sort.Slice(pricingMap, func(i, j int) bool { |
|
|
|
mi, okI := metaMap[pricingMap[i].ModelName] |
|
|
|
mj, okJ := metaMap[pricingMap[j].ModelName] |
|
|
|
if okI && okJ { |
|
|
|
if mi.SortOrder != mj.SortOrder { |
|
|
|
return mi.SortOrder < mj.SortOrder |
|
|
|
} |
|
|
|
} else if okI { |
|
|
|
return true |
|
|
|
} else if okJ { |
|
|
|
return false |
|
|
|
si := 999999 |
|
|
|
sj := 999999 |
|
|
|
if okI { |
|
|
|
si = mi.SortOrder |
|
|
|
} |
|
|
|
if okJ { |
|
|
|
sj = mj.SortOrder |
|
|
|
} |
|
|
|
if si != sj { |
|
|
|
return si < sj |
|
|
|
} |
|
|
|
return pricingMap[i].ModelName < pricingMap[j].ModelName |
|
|
|
}) |
|
|
|
|