yjp hai 1 ano
pai
achega
4be4110357
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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