From 20bbbcc1d14536ddaa498ac84a6008828df8dc1c Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期三, 13 十二月 2023 20:23:11 +0800 Subject: [PATCH] 往plc写目标数时,优先往写入地址写,没有写入地址再往读取地址写 --- model/util.go | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/model/util.go b/model/util.go index 224ad68..a7f8519 100644 --- a/model/util.go +++ b/model/util.go @@ -1,14 +1,14 @@ package model import ( - "apsClient/pkg/mysqlx" + "apsClient/pkg/sqlitex" "fmt" - "gorm.io/gorm" + "github.com/jinzhu/gorm" ) // WithTransaction 锛� var funcs []func(db *gorm.DB) error锛屾妸鐩稿叧鍑芥暟娣诲姞杩涘幓 func WithTransaction(fns ...func(*gorm.DB) error) (err error) { - tx := mysqlx.GetDB().Begin() + tx := sqlitex.GetDB().Begin() defer func() { if r := recover(); r != nil { tx.Rollback() -- Gitblit v1.8.0