|
|
|
@ -18,7 +18,7 @@ func CreateVisitor(name, avator, sourceIp, toId, visitorId, refer, city, clientI
|
|
|
|
|
old := FindVisitorByVistorId(visitorId)
|
|
|
|
|
if old.Name != "" {
|
|
|
|
|
//更新状态上线
|
|
|
|
|
UpdateVisitor(visitorId, 1, clientIp, sourceIp, refer)
|
|
|
|
|
UpdateVisitor(visitorId, 1, clientIp, sourceIp, refer, extra)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
v := &Visitor{
|
|
|
|
@ -67,12 +67,13 @@ func UpdateVisitorStatus(visitorId string, status uint) {
|
|
|
|
|
visitor := Visitor{}
|
|
|
|
|
DB.Model(&visitor).Where("visitor_id = ?", visitorId).Update("status", status)
|
|
|
|
|
}
|
|
|
|
|
func UpdateVisitor(visitorId string, status uint, clientIp string, sourceIp string, refer string) {
|
|
|
|
|
func UpdateVisitor(visitorId string, status uint, clientIp string, sourceIp string, refer, extra string) {
|
|
|
|
|
visitor := &Visitor{
|
|
|
|
|
Status: status,
|
|
|
|
|
ClientIp: clientIp,
|
|
|
|
|
SourceIp: sourceIp,
|
|
|
|
|
Refer: refer,
|
|
|
|
|
Extra: extra,
|
|
|
|
|
}
|
|
|
|
|
DB.Model(visitor).Where("visitor_id = ?", visitorId).Update(visitor)
|
|
|
|
|
}
|
|
|
|
|