- user man and user store bind.

This commit is contained in:
gazebo
2018-09-12 15:18:56 +08:00
parent 05bd085116
commit 0fd377e0d3
6 changed files with 264 additions and 6 deletions

View File

@@ -187,3 +187,17 @@ func DeleteEntity(db *DaoDB, item interface{}, conditions map[string]interface{}
}, reflect.TypeOf(item).Name())
return num, err
}
func UpdateBySQL(db *DaoDB, sql string, params ...interface{}) (num int64, err error) {
if db == nil {
db = GetDB()
}
err = utils.CallFuncLogError(func() error {
result, err2 := db.db.Raw(sql, params...).Exec()
if err2 == nil {
num, _ = result.RowsAffected()
}
return err2
}, sql)
return num, err
}

View File

@@ -1,12 +1,12 @@
package model
type WeiXins struct {
ID int `orm:"column(id)"`
JxStoreID int `orm:"column(jxstoreid)"`
OpenID string `orm:"column(openid);size(70);index"`
Tel string `orm:"size(15);index"`
ParentID int `orm:"column(parentid)"`
NickName string `orm:"column(nickname);size(30)"`
ID int `orm:"column(id)" json:"id"`
JxStoreID int `orm:"column(jxstoreid)" json:"storeID"`
OpenID string `orm:"column(openid);size(70);index" json:"openID"`
Tel string `orm:"size(15);index" json:"tel"`
ParentID int `orm:"column(parentid)" json:"parentID"`
NickName string `orm:"column(nickname);size(30)" json:"nickname"`
}
func (*WeiXins) TableName() string {