Merge branch 'feat-IRONFANS-70' into test
This commit is contained in:
commit
90be5cb8cb
|
@ -267,12 +267,12 @@ func (m *Mysql) DecZoneConsume(ctx *gin.Context, tx *sqlx.Tx, mid, zid, inc int6
|
|||
func (m *Mysql) AddZoneMember(ctx *gin.Context, tx *sqlx.Tx, mid, zid int64, memType int32) error {
|
||||
var err error
|
||||
// 先获取,没有再添加
|
||||
var tmpZm *dbstruct.ZoneMember
|
||||
var tmpZm dbstruct.ZoneMember
|
||||
if tx != nil {
|
||||
err = tx.GetContext(ctx, tmpZm, fmt.Sprintf("select * from %s where mid=? and zid=? and member_type=?", TableVasZoneMember), mid, zid, memType)
|
||||
err = tx.GetContext(ctx, &tmpZm, fmt.Sprintf("select * from %s where mid=? and zid=? and member_type=?", TableVasZoneMember), mid, zid, memType)
|
||||
} else {
|
||||
db := m.getDBVas()
|
||||
err = db.GetContext(ctx, tmpZm, fmt.Sprintf("select * from %s where mid=? and zid=? and member_type=?", TableVasZoneMember), mid, zid, memType)
|
||||
err = db.GetContext(ctx, &tmpZm, fmt.Sprintf("select * from %s where mid=? and zid=? and member_type=?", TableVasZoneMember), mid, zid, memType)
|
||||
}
|
||||
if err == sql.ErrNoRows {
|
||||
err = nil
|
||||
|
@ -280,7 +280,7 @@ func (m *Mysql) AddZoneMember(ctx *gin.Context, tx *sqlx.Tx, mid, zid int64, mem
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if tmpZm != nil {
|
||||
if tmpZm.GetMid() == mid && tmpZm.GetZid() == zid && tmpZm.GetMemberType() == memType {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue