优化代码结构,修复查询逻辑,添加构建脚本

This commit is contained in:
2025-08-09 16:17:41 +08:00
parent 4bbc05fe1f
commit 3782feaf85
8 changed files with 38 additions and 15 deletions

View File

@@ -2,14 +2,15 @@ package actions
import (
"fmt"
"gorm.io/gorm"
"math"
"zzman/model"
"gorm.io/gorm"
)
func FindGateways(tx *gorm.DB) ([]model.Gateway, error) {
var gateways []model.Gateway
err := tx.Find(gateways).Error
err := tx.Where("enable = 1").Find(&gateways).Error
if err != nil {
return nil, err
}