Commit 7eb9cd7d authored by honghuiliu's avatar honghuiliu 💬

日常提交

parent d96918e2
......@@ -6,6 +6,7 @@ import (
"github.com/flipped-aurora/gin-vue-admin/server/model/admin"
"github.com/flipped-aurora/gin-vue-admin/server/request"
"github.com/flipped-aurora/gin-vue-admin/server/server"
"gorm.io/gorm"
)
type DataService struct {
......@@ -32,7 +33,9 @@ func (s *DataService) DataInYeWei(arg server.YeWeiData) error {
func (s *DataService) GetYewei(arg request.GetYewei) (admin.QshMonitorData, error) {
var data admin.QshMonitorData
err := global.GVA_DB.Model(admin.QshMonitorData{}).Where("toilet_id = ?", arg.ToiletID).Where("type_name = ?", "液位").Last(&data).Error
if err != nil {
if err != nil && errors.Is(err, gorm.ErrRecordNotFound) {
return data, nil
} else {
return data, err
}
return data, nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment