yjp 1 vuosi sitten
vanhempi
commit
4be4110357
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 5 0
      sdk/sql.go

+ 5 - 0
sdk/sql.go

@@ -331,6 +331,11 @@ func Query[T any](executor SqlExecutor, tableName string, e T, pageNo int, pageS
 			conditionOp = retConditionOp
 		}
 
+		// 字段为空不更新
+		if reflect.ValueOf(conditionValue).IsZero() {
+			continue
+		}
+
 		tableRowValue, err := parseValue(conditionValue)
 		if err != nil {
 			return nil, 0, err