This commit is contained in:
Daniel 2024-04-15 13:27:19 +08:00
parent 483ae3b671
commit a049eeec3e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 21 additions and 11 deletions

View file

@ -119,13 +119,19 @@ func (value *Value) Compare(other *Value, attrView *AttributeView) int {
return 0
}
case KeyTypeSelect, KeyTypeMSelect:
if 0 < len(value.MSelect) && 0 < len(other.MSelect) {
v1 := value.MSelect[0].Content
v2 := other.MSelect[0].Content
if v1 == v2 {
return 0
if nil != value.MSelect && nil != other.MSelect {
var v1 string
for _, v := range value.MSelect {
v1 += v.Content
break
}
var v2 string
for _, v := range other.MSelect {
v2 += v.Content
break
}
// 按设置的选项顺序排序
key, _ := attrView.GetKey(value.KeyID)
if nil != key {
optionSort := map[string]int{}