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=?"
list, _ := db.SQL(sql, personId).Query().List()
//调用orm进行保存
var tLog models.TSysLoginpersonLog
tLog.BureauId=list[0]["bureau_id"].(string)
tLog.IdentityId=CommonUtil.ConvertStringToInt32(identityId)
tLog.PersonId=list[0]["person_id"].(string)
tLog.ProvinceCode=list[0]["province_code"].(string)
tLog.CityCode=list[0]["city_code"].(string)
tLog.DistrictCode=list[0]["district_code"].(string)
tLog.IpAddress=ip
tLog.LoginName=loginName
tLog.LoginState=int32(loginState)
tLog.BureauId = list[0]["bureau_id"].(string)
tLog.IdentityId = CommonUtil.ConvertStringToInt32(identityId)
tLog.PersonId = personId
tLog.ProvinceCode = list[0]["province_code"].(string)
tLog.CityCode = list[0]["city_code"].(string)
tLog.DistrictCode = list[0]["district_code"].(string)
tLog.IpAddress = ip
tLog.LoginName = loginName
tLog.LoginState = int32(loginState)
_, err := db.Insert(tLog)
if err!=nil{
if err != nil {
fmt.Println(err.Error())
}
}

Loading…
Cancel
Save