packageuser_mimport("git.hilo.cn/hilo-common/domain""git.hilo.cn/hilo-common/resource/mysql""hilo-group/myerr")//获取用户的国家,和所属的区域(是否阿语区)funcGetUserCountryArea(model*domain.Model,idmysql.ID)(string,int,error){typeinfostruct{NamestringAreaint}res:=new(info)iferr:=model.DB().Raw("select name, area from res_country where name = (select country from user where id = ?)",id).First(&res).Error;err!=nil{return"",0,myerr.WrapErr(err)}returnres.Name,res.Area,nil}