瀏覽代碼

list null

0x4a52466c696e74 2 月之前
父節點
當前提交
ae655ee9c2
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1 3
      rest_gorm/request_list.go

+ 1 - 3
rest_gorm/request_list.go

@@ -2,7 +2,6 @@ package rest_gorm
 
 import (
 	"fmt"
-	"log"
 
 	"git.ali33.ru/fcg-xvii/rest"
 	"gorm.io/gorm"
@@ -37,8 +36,7 @@ func (s *List) Result(pg *gorm.DB, fields rest.FieldNamesList, res any) (count i
 			err = rest.ErrorFiled(cond.Field, "Unexpected field")
 			return
 		}
-		log.Println("CV", cond.Value)
-		if cond.Value == nil {
+		if cond.Value != nil {
 			q := fmt.Sprintf("%s %s ?", CamelToSnake(cond.Field), cond.Operator)
 			if i == 0 || cond.Logic == rest.LogicAND {
 				pg = pg.Where(q, cond.Value)