fix: serial number of NE license

This commit is contained in:
2023-12-26 10:59:47 +08:00
parent a066bb3692
commit 562244d0db
2 changed files with 61 additions and 8 deletions

View File

@@ -1820,3 +1820,19 @@ func XormGetTraceRawMsg(id int) (int64, []byte, error) {
return timestamp, rawMsg, nil
}
func XormGetNESN(neType, neID string) (string, error) {
SN := "-"
_, err := xEngine.Table("ne_state").
Where("ne_type=? and ne_id=?", neType, neID).
Asc("timestamp").
Cols("serial_num").
Limit(1).
Get(&SN)
if err != nil {
log.Error("Failed to get table ne_state:", err)
return SN, err
}
return SN, nil
}