|  | @@ -11,6 +11,8 @@ type User struct {
 | 
	
		
			
				|  |  |  	Phone      string `gorm:"column:phone" json:"phone"`
 | 
	
		
			
				|  |  |  	Pid        string `gorm:"column:pid" json:"pid"`
 | 
	
		
			
				|  |  |  	UpdateTime string `gorm:"column:update_time" json:"updateTime"`
 | 
	
		
			
				|  |  | +	NickName   string `gorm:"column:nick_name" json:"nickName"`
 | 
	
		
			
				|  |  | +	AvatarUrl  string `gorm:"column:avatar_url" json:"avatarUrl"`
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  // TableName sets the insert table name for this struct type
 | 
	
	
		
			
				|  | @@ -28,7 +30,7 @@ func (u *User) GetNum() int {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  func (u *User) Get() (User, error) {
 | 
	
		
			
				|  |  |  	var doc User
 | 
	
		
			
				|  |  | -	err := orm.Eloquent.Select("pid").Where("open_id = ? ", u.OpenID).Table(u.TableName()).First(&doc).Error
 | 
	
		
			
				|  |  | +	err := orm.Eloquent.Select("pid,nick_name,avatar_url").Where("open_id = ? ", u.OpenID).Table(u.TableName()).First(&doc).Error
 | 
	
		
			
				|  |  |  	if err != nil {
 | 
	
		
			
				|  |  |  		return doc, err
 | 
	
		
			
				|  |  |  	}
 | 
	
	
		
			
				|  | @@ -58,3 +60,16 @@ func (u *User) Update() (update User, err error) {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	return update, nil
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +func (u *User) UpdateName() (update User, err error) {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	if err := orm.Eloquent.Table(u.TableName()).Model(&update).Where("open_id = ? ", u.OpenID).Updates(
 | 
	
		
			
				|  |  | +		map[string]interface{}{
 | 
	
		
			
				|  |  | +			"nick_name":   u.NickName,
 | 
	
		
			
				|  |  | +			"avatar_url":  u.AvatarUrl,
 | 
	
		
			
				|  |  | +			"update_time": tools.GetCurrntTimeStr()}).Error; err != nil {
 | 
	
		
			
				|  |  | +		return update, err
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	return update, nil
 | 
	
		
			
				|  |  | +}
 |