更新扩展字段信息

pull/23/head
陶士涵 4 years ago
parent 4289b49939
commit f79186716e

@ -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)
}

@ -382,6 +382,7 @@ var app=new Vue({
//_this.visitor.visitor_id=r.visitor_id;
_this.chatTitle="#"+r.id+"|"+r.name;
_this.chatTitleType="success";
_this.visitorExtra=[];
if(r.extra!=""){
var extra=JSON.parse(b64ToUtf8(r.extra));
for(var key in extra){

Loading…
Cancel
Save