master
huanghai 5 years ago
parent 735cd5ebac
commit b77f09b172

@ -85,20 +85,20 @@ func WriteLoginLog(identityId string, personId string, ip string, loginState int
//查询出结果 //查询出结果
sql := "select province_code,city_code,district_code,bureau_id from " + tableName + " where person_id=?" sql := "select province_code,city_code,district_code,bureau_id from " + tableName + " where person_id=?"
list, _ := db.SQL(sql, personId).Query().List() list, _ := db.SQL(sql, personId).Query().List()
//调用orm进行保存 //调用orm进行保存
var tLog models.TSysLoginpersonLog var tLog models.TSysLoginpersonLog
tLog.BureauId=list[0]["bureau_id"].(string) tLog.BureauId = list[0]["bureau_id"].(string)
tLog.IdentityId=CommonUtil.ConvertStringToInt32(identityId) tLog.IdentityId = CommonUtil.ConvertStringToInt32(identityId)
tLog.PersonId=list[0]["person_id"].(string) tLog.PersonId = personId
tLog.ProvinceCode=list[0]["province_code"].(string) tLog.ProvinceCode = list[0]["province_code"].(string)
tLog.CityCode=list[0]["city_code"].(string) tLog.CityCode = list[0]["city_code"].(string)
tLog.DistrictCode=list[0]["district_code"].(string) tLog.DistrictCode = list[0]["district_code"].(string)
tLog.IpAddress=ip tLog.IpAddress = ip
tLog.LoginName=loginName tLog.LoginName = loginName
tLog.LoginState=int32(loginState) tLog.LoginState = int32(loginState)
_, err := db.Insert(tLog) _, err := db.Insert(tLog)
if err!=nil{ if err != nil {
fmt.Println(err.Error()) fmt.Println(err.Error())
} }
} }

Loading…
Cancel
Save