Browse Source

修改bug

yjp 1 month ago
parent
commit
1649c3ee52

+ 3 - 1
framework/core/infrastructure/database/clause/condition.go

@@ -17,7 +17,9 @@ func NewConditions() *Conditions {
 
 
 func (conditions *Conditions) AddCondition(query string, args ...any) *Conditions {
 func (conditions *Conditions) AddCondition(query string, args ...any) *Conditions {
 	conditions.queries = append(conditions.queries, query)
 	conditions.queries = append(conditions.queries, query)
-	conditions.args = append(conditions.args, args)
+	for _, arg := range args {
+                conditions.args = append(conditions.args, []any{arg})
+        }
 	return conditions
 	return conditions
 }
 }
 
 

+ 3 - 1
framework/core/infrastructure/database/sql/conditions.go

@@ -25,7 +25,9 @@ func NewConditions() *Conditions {
 // - 数据库条件
 // - 数据库条件
 func (conditions *Conditions) AddCondition(query string, args ...any) *Conditions {
 func (conditions *Conditions) AddCondition(query string, args ...any) *Conditions {
 	conditions.queries = append(conditions.queries, query)
 	conditions.queries = append(conditions.queries, query)
-	conditions.args = append(conditions.args, args)
+        for _, arg := range args {
+                conditions.args = append(conditions.args, []any{arg})
+        }
 	return conditions
 	return conditions
 }
 }