123456789101112131415161718192021 |
- package mqtt
- import (
- "kpt-pasture/model"
- pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
- )
- // NeckRingIsBind 脖环是否绑定
- func (e *Entry) NeckRingIsBind(number string) bool {
- var count int64 = 0
- if err := e.DB.Model(new(model.NeckRing)).Where("number = ?", number).
- Where("status != ?", pasturePb.NeckRingStatus_Unbind).
- Count(&count).Error; err != nil {
- return false
- }
- if count > 0 {
- return true
- }
- return false
- }
|