소스 검색

修改bug

yjp 1 년 전
부모
커밋
4be4110357
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  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