Browse Source

Merge branch 'develop' of k.zhang/duoduo into master

k.zhang 3 years ago
parent
commit
197cd7f1f2
2 changed files with 9 additions and 3 deletions
  1. 2 2
      apis/pdd/set.go
  2. 7 1
      models/mysql/user.go

+ 2 - 2
apis/pdd/set.go

@@ -16,10 +16,10 @@ func Set(c *gin.Context) {
 		return
 	}
 
-	if inData.Version == "1.0.4" {
+	if inData.Version == "1.0.6" {
 		outData.Type = "true"
 		app.OK(c, outData, app.Success)
-	} else if inData.Version == "2.1.1"{
+	} else if inData.Version == "2.1.1" {
 		outData.Type = "true"
 		app.OK(c, outData, app.Success)
 	} else {

+ 7 - 1
models/mysql/user.go

@@ -16,6 +16,9 @@ type User struct {
 	AvatarUrl  string `gorm:"column:avatar_url" json:"avatarUrl"`
 	OpenIdOne  string `gorm:"column:open_id_1" json:"openIdOne"`
 	OpenIdTwo  string `gorm:"column:open_id_2" json:"openIdTwo"`
+	Admin      int    `gorm:"column:admin" json:"admin"`    //1-管理员
+	AliPay     string `gorm:"column:ali_pay" json:"aliPay"` //
+	WxPay      string `gorm:"column:wx_pay" json:"wxPay"`
 }
 
 type UserName struct {
@@ -29,6 +32,9 @@ type UserName struct {
 	OpenIdOne  string `gorm:"column:open_id_1" json:"openIdOne"`
 	OpenIdTwo  string `gorm:"column:open_id_2" json:"openIdTwo"`
 	Id         int    `gorm:"column:id" json:"id"`
+	Admin      int    `gorm:"column:admin" json:"admin"`    //1-管理员 2-超级管理员
+	AliPay     string `gorm:"column:ali_pay" json:"aliPay"` //
+	WxPay      string `gorm:"column:wx_pay" json:"wxPay"`
 }
 
 // TableName sets the insert table name for this struct type
@@ -46,7 +52,7 @@ func (u *User) GetNum() int {
 
 func (u *User) Get() (UserName, error) {
 	var doc UserName
-	err := orm.Eloquent.Select("id,pid,nick_name,avatar_url,open_id_1,open_id_2").Where("open_id = ? ", u.OpenID).Table(u.TableName()).First(&doc).Error
+	err := orm.Eloquent.Select("id,pid,nick_name,avatar_url,open_id_1,open_id_2,admin,wx_pay,ali_pay").Where("open_id = ? ", u.OpenID).Table(u.TableName()).First(&doc).Error
 	if err != nil {
 		return doc, err
 	}