fix: serial number of NE license
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user